smys x y A;
L = A*(-2*x -y -3) + 2*x^2 - 2*x*y + 3*y^2;
Lx = diff(L, x);
Ly = diff(L, y);
LA = diff(L, A);
a = solve(Lx, Ly, LA);
a = [a.x, a.y, a.A]
a =
[ -7/6, -2/3, -5/3]
Now this piece looks ok and doing
subs(Lx, {x,y,A}, a)
Gives the expected 0, however, if I were to take the values and manually calculate the Lx/Ly/LA I get anything but 0. Why is it so?
It is correct. If I didn’t break the calculations it looks like
and thus
The same holds for
LyandLA.