Multivariable calculus

Partial Derivatives of xy e^(-x^2 - y^2)

For f(x,y) = xy e^(-x^2 - y^2), the partial with respect to x is y(1 - 2x^2)e^(-x^2 - y^2) and the partial with respect to y is x(1 - 2y^2)e^(-x^2 - y^2). Both need the product rule, since each variable appears once in the polynomial factor and again inside the exponent.

f(x,y)=xyex2y2f(x,y) = xy\,e^{-x^{2}-y^{2}}
fx=y(12x2)ex2y2\frac{\partial f}{\partial x} = y\left(1 - 2x^{2}\right)e^{-x^{2}-y^{2}}
fy=x(12y2)ex2y2\frac{\partial f}{\partial y} = x\left(1 - 2y^{2}\right)e^{-x^{2}-y^{2}}

Product rule with a Gaussian factor

Each variable appears twice: once in the polynomial factor xyxy and once in the exponent. So both partials need the product rule, and in each case the exponential contributes its own chain rule factor.

Differentiating in xx, treat yy as a constant. The polynomial part contributes yy, and the exponential contributes 2x-2x times itself.

fx=yex2y2+xy(2x)ex2y2\frac{\partial f}{\partial x} = y\,e^{-x^{2}-y^{2}} + xy\left(-2x\right)e^{-x^{2}-y^{2}}

The exponential is common to both terms, so factor it out along with the yy. What is left inside the bracket is the informative part.

fx=y(12x2)ex2y2\frac{\partial f}{\partial x} = y\left(1 - 2x^{2}\right)e^{-x^{2}-y^{2}}

The function is symmetric in xx and yy, so the yy-partial is the same expression with the letters swapped.

fy=x(12y2)ex2y2\frac{\partial f}{\partial y} = x\left(1 - 2y^{2}\right)e^{-x^{2}-y^{2}}

The mistake: dropping a term or a sign in the exponent

Two errors are worth naming. The first is writing the xx-partial as 2x2yex2y2-2x^{2}y\,e^{-x^{2}-y^{2}}, which keeps only the second product rule term. The second is losing the minus sign on the chain rule factor and getting 1+2x21 + 2x^{2} inside the bracket, which never vanishes and so destroys the critical point structure.

  • The exponent is x2y2-x^{2}-y^{2}, so its xx-derivative is 2x-2x and its yy-derivative is 2y-2y.
  • The bracket 12x21 - 2x^{2} is zero at x=±12x = \pm\frac{1}{\sqrt{2}}, which is the xx-coordinate of the four peaks and valleys, not a peak on its own.
  • The exponential factor is positive everywhere, so it never creates a zero of its own.

Setting both partials to zero gives y(12x2)=0y(1-2x^{2}) = 0 and x(12y2)=0x(1-2y^{2}) = 0. The solutions are the origin, which is a saddle, and the four points where xx and yy are each ±12\pm\frac{1}{\sqrt{2}}, which are the two peaks and two valleys of this classic bump surface.

A worked evaluation

At (1,1)(1,1) the exponent is 2-2, and the bracket 12(1)2=11 - 2(1)^{2} = -1 for both partials.

f(1,1)=e2,  e2\nabla f(1,1) = \left\langle -e^{-2},\; -e^{-2} \right\rangle

Both components are about 0.135-0.135. The point (1,1)(1,1) sits outside the peak at (12,12)\left(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right), so moving further out in either direction sends you downhill, which is exactly what the negative signs say.

Frequently asked questions

Why does the exponential appear in both terms of the product rule?

Because it is a factor of the original function and also the derivative of itself up to a constant. Differentiating xyxy leaves the exponential untouched, and differentiating the exponential leaves xyxy untouched, so every term carries ex2y2e^{-x^{2}-y^{2}}. That is why factoring it out is always the right next step.

How do I know the origin is a saddle rather than a peak?

Look at the function along two lines through the origin. On the line y=xy = x the function is x2e2x2x^{2}e^{-2x^{2}}, which is positive on both sides. On the line y=xy = -x it is x2e2x2-x^{2}e^{-2x^{2}}, which is negative on both sides. Rising in one direction and falling in another is precisely a saddle.