MATLAB: Finding the null gradient

fsolvegradient

Hello, I'm kind of struggling with a problem.
If
syms x y
g = gradient ([x^2 + x, y^2 - y], [x, y])
How can I determine [x, y] which make the gradient vector null?
I tried to use fsolve but couldn't get it to work.
A bit lost here. tks

Best Answer

See if this does what you want:
syms x y
f = [x^2 + x, y^2 - y];
g1 = gradient(f(1), [x, y]);
g2 = gradient(f(2), [x, y]);
x0 = solve(g1 == 0)
y0 = solve(g2 == 0)