# 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[%[]]


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}]]
%[]
Eigenvalues[%]


Why? In other words, why is

Function[%[]]


different from

%[]
Function[%]


?

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[%[]] 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 :/ – Julian Wittische Aug 6 '13 at 12:59
• @Ouistiti Yes; please read this for another example. – Mr.Wizard Aug 7 '13 at 8:32