Multivariable calculus

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

The partials of e^(-x^2 - 2y^2) are f_x = -2x e^(-x^2 - 2y^2) and f_y = -4y e^(-x^2 - 2y^2). The exponential reappears unchanged, multiplied by the partial of the exponent. The 2 already sitting in front of y^2 doubles into a 4, which is the step most often missed.

f(x,y)=ex22y2f(x,y) = e^{-x^2 - 2y^2}
fx=2xex22y2\frac{\partial f}{\partial x} = -2x\,e^{-x^2 - 2y^2}
fy=4yex22y2\frac{\partial f}{\partial y} = -4y\,e^{-x^2 - 2y^2}

Differentiate the exponent, keep the exponential

Let u=x22y2u = -x^2 - 2y^2. Since ddueu=eu\frac{d}{du}e^u = e^u, the exponential survives untouched and the chain rule supplies the inner partial as a multiplier.

fx=ex22y2(2x)=2xex22y2\frac{\partial f}{\partial x} = e^{-x^2-2y^2}\cdot(-2x) = -2x\,e^{-x^2-2y^2}
fy=ex22y2(4y)=4yex22y2\frac{\partial f}{\partial y} = e^{-x^2-2y^2}\cdot(-4y) = -4y\,e^{-x^2-2y^2}

The yy coefficient is the one to watch. Differentiating 2y2-2y^2 gives 4y-4y, not 2y-2y: the 22 that was already there multiplies the 22 the power rule brings down.

Two minus signs and one coefficient

Two minus signs are in play, the one inside the exponent and the one the chain rule pulls out of it. Producing +2xex22y2+2x\,e^{-x^2-2y^2} claims the bump rises as you move right of the origin, and it does not: for x>0x > 0 the surface falls away, so fxf_x must be negative there.

The coefficient is the second trap. Writing fy=2yex22y2f_y = -2y\,e^{-x^2-2y^2} copies the shape of the xx partial and loses the 22 from the exponent. At (0,1)(0,1) the true value is 4e20.541-4e^{-2} \approx -0.541 while that version gives 2e20.271-2e^{-2} \approx -0.271, exactly half.

Neither mistake can hide behind the exponential, because ex22y2e^{-x^2-2y^2} is strictly positive for every real input. The sign and the size of each partial are decided entirely by the factor in front of it.

The gradient does not point at the peak

Collecting the partials gives f=2ex22y2(x,2y)\nabla f = -2e^{-x^2-2y^2}(x,\,2y). The vector (x,2y)(x, 2y) is parallel to (x,y)(x,y) only on the two axes, so everywhere else the gradient leans toward the yy direction, which is the direction the bump falls off faster.

At (1,1)(1,1) the gradient is about (0.0996,0.1992)(-0.0996,\, -0.1992): the yy component is twice the xx component, so the fastest way uphill runs along (1,2)-(1,2), a line that crosses the xx axis at (0.5,0)(0.5,\,0) rather than passing through the origin. The level curves are the ellipses x2+2y2=cx^2 + 2y^2 = c, and the gradient is perpendicular to those, not to circles.

Both partials vanish only at (0,0)(0,0), where f=1f = 1. Since x22y20-x^2 - 2y^2 \le 0 everywhere, fe0=1f \le e^0 = 1 everywhere, so that lone critical point is the global maximum and the second derivative test is not needed to say so.

Frequently asked questions

Where does the 4 in the y partial come from?

From two twos multiplying. The exponent already carries a coefficient of 22 on y2y^2, and the power rule brings down another 22 when it differentiates y2y^2, so y(2y2)=4y\frac{\partial}{\partial y}(-2y^2) = -4y. That whole factor then multiplies the exponential.

Is the maximum still at the origin?

Yes. The exponential is never zero, so 2xex22y2=0-2x\,e^{-x^2-2y^2} = 0 forces x=0x = 0 and 4yex22y2=0-4y\,e^{-x^2-2y^2} = 0 forces y=0y = 0. The only critical point is (0,0)(0,0), and the bound f1f \le 1 makes it the global maximum. Stretching the bump into an ellipse moves nothing.