0
$\begingroup$

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

enter image description here

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?

$\endgroup$
2
  • 3
    $\begingroup$ Have you tried substituting your putative solutions into the gradient you originally computed as a check? $\endgroup$ Oct 3, 2018 at 15:53
  • $\begingroup$ 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}]. $\endgroup$
    – JimB
    Oct 3, 2018 at 16:54

1 Answer 1

3
$\begingroup$
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}]

enter image description here

(* {{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}} *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.