# Why do two codes give different output?

I have tried the following to get the eigenvalues of several matrices of the type:

J := D[{i – l*r – ux*r*x – uy*r*y, -mx*x + ex*ux*r*x, -my*y +
ey*uy*r*y}, {{r, x, y}}] // StandardForm

Then with three possible solutions given by Solve

FullSimplify[J/. Solve[i – l*r – ux*r*x – uy*r*y == 0 && -mx*x + ex*ux*r*x ==
0 && -my*y + ey*uy*r*y == 0, {r, x, y}]]
Eigenvalues[%[[1]]]

But it does not give me the eigenvalues, it just outputs:

Eigenvalues[{{-l, -((i ux)/l), -((i uy)/l)}, {0, -mx + (ex i ux)/l, 0}, {0, 0, -my + (ey i uy)/l}}]

Only the following code gives them:

FullSimplify[J/. Solve[i – l*r – ux*r*x – uy*r*y == 0 && -mx*x + ex*ux*r*x ==
0 && -my*y + ey*uy*r*y == 0, {r, x, y}]]
%[[1]]
Eigenvalues[%]

Why? In other words, why is

Function[%[[1]]]

different from

%[[1]]
Function[%]

?

=================

=================

1

=================

StandardForm is a wrapper.

j = D[{i – l*r – ux*r*x – uy*r*y, -mx*x + ex*ux*r*x, -my*y + ey*uy*r*y}, {{r, x, y}}];

FullSimplify[j /. Solve[
i – l*r – ux*r*x – uy*r*y == 0 && -mx*x + ex*ux*r*x ==
0 && -my*y + ey*uy*r*y == 0, {r, x, y}]];

Eigenvalues[%[[1]]]

ps. no need to use j:= just use j= and try not to use UPPERCASE for first letters.

Thanks, I did not know that SandardForm could have effects on the following calculations :/
– Ouistiti
Aug 6 ’13 at 12:59

1