# Solve command code problem with system of equations

This is my original equation

f[x_, y_] = (4 x^2 + y^2)*Exp[-x^2 - y^2];


So I'm trying to find the partial derivatives w/ respect to $$x$$ and $$y$$ and set them equal to $$0$$ to find the critical points. First I found the partial derivatives.

So this is $$f_{x}$$

 In[4]:= D[f[x, y], {x, 1}]

Out[4]= 8 E^(-x^2 - y^2) x - 2 E^(-x^2 - y^2) x (4 x^2 + y^2)


and this is $$f_{y}$$

In[5]:= D[f[x, y], {y, 1}]

Out[5]= 2 E^(-x^2 - y^2) y - 2 E^(-x^2 - y^2) y (4 x^2 + y^2)


and this is where I ran into a problem. After finding the partial derivatives, you're supposed to set them equal to $$0$$ and solve for $$x$$ and $$y$$, so I tried to do that:

Solve[{8 E^(-x^2 - y^2) x - 2 E^(-x^2 - y^2) x (4 x^2 + y^2) == 0,
2 E^(-x^2 - y^2) y - 2 E^(-x^2 - y^2) y (4 x^2 + y^2) == 0}, {x, y}]


This is the display

So from what I know the only critical points I need are $$(0,0),(-1,0), and (1,0)$$. Can you tell me how fix the errors?

• Have you tried substituting your putative solutions into the gradient you originally computed as a check? Commented Oct 3, 2018 at 15:53
• Plotting a function is almost always helpful: ContourPlot[f[x, y], {x, -2, 2}, {y, -2, 2}, Contours -> 20] or Plot3D[f[x, y], {x, -2, 2}, {y, -2, 2}].
– JimB
Commented Oct 3, 2018 at 16:54

f[x_, y_] = (4 x^2 + y^2)*Exp[-x^2 - y^2];

der = D[f[x, y], {{x, y}}]

{8 E^(-x^2 - y^2) x - 2 E^(-x^2 - y^2) x (4 x^2 + y^2),
2 E^(-x^2 - y^2) y - 2 E^(-x^2 - y^2) y (4 x^2 + y^2)}

solns = Solve[der == 0, {x, y}]


(* {{x -> -1, y -> 0}, {x -> 0, y -> 0}, {x -> 1, y -> 0}, {x -> 0,
y -> -1}, {x -> 0, y -> 1}} *)


Verifying the solutions,

der /. solns

{{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}}


Or as suggested in the messages, using Reduce

solns2 = Solve[der == 0, {x, y}, Method -> Reduce]

(* {{x -> -1, y -> 0}, {x -> 0, y -> -1}, {x -> 0, y -> 0}, {x -> 0,
y -> 1}, {x -> 1, y -> 0}} *)


or

solns3 = {Reduce[der == 0, {x, y}] // ToRules}

(* {{x -> 0, y -> 0}, {x -> 0, y -> -1}, {x -> 0, y -> 1}, {x -> -1,
y -> 0}, {x -> 1, y -> 0}} *)