Multivariable calculus

Second partials of sin(x + y^2)

For f(x,y) = sin(x + y^2) the second partials are f_xx = -sin(x + y^2), f_xy = f_yx = -2y sin(x + y^2), and f_yy = 2 cos(x + y^2) - 4y^2 sin(x + y^2). Only f_yy needs the product rule, because the first partial 2y cos(x + y^2) has y in two places.

f(x,y)=sin(x+y2)f(x,y) = \sin\bigl(x + y^{2}\bigr)
fx=cos(x+y2)\frac{\partial f}{\partial x} = \cos\bigl(x + y^{2}\bigr)
fy=2ycos(x+y2)\frac{\partial f}{\partial y} = 2y\cos\bigl(x + y^{2}\bigr)

Second and mixed partials

2fx2=sin(x+y2)\frac{\partial^2 f}{\partial x^2} = -\sin\bigl(x + y^{2}\bigr)
2fyx=2ysin(x+y2)\frac{\partial^2 f}{\partial y\,\partial x} = -2y\sin\bigl(x + y^{2}\bigr)
2fy2=2cos(x+y2)4y2sin(x+y2)\frac{\partial^2 f}{\partial y^2} = 2\cos\bigl(x + y^{2}\bigr) - 4y^{2}\sin\bigl(x + y^{2}\bigr)

One inner function, two different inner derivatives

The inside is u=x+y2u = x + y^{2}. Its derivative is 11 in the xx direction and 2y2y in the yy direction, and that single difference drives everything on this page.

fx=cos(x+y2),fy=2ycos(x+y2)\frac{\partial f}{\partial x} = \cos\bigl(x+y^{2}\bigr), \qquad \frac{\partial f}{\partial y} = 2y\cos\bigl(x+y^{2}\bigr)

Because the inner xx derivative is 11, the xx direction behaves like a plain single variable sine wave: fxx=sin(x+y2)=ff_{xx} = -\sin(x+y^{2}) = -f. Differentiating fxf_x in yy pulls out the inner derivative 2y2y.

2fx2=sin(x+y2),2fyx=2ysin(x+y2)\frac{\partial^2 f}{\partial x^2} = -\sin\bigl(x+y^{2}\bigr), \qquad \frac{\partial^2 f}{\partial y\,\partial x} = -2y\sin\bigl(x+y^{2}\bigr)

The yy second derivative is the only one that needs the product rule, since fy=2ycos(x+y2)f_y = 2y\cos(x+y^{2}) has yy in the leading factor and inside the cosine.

2fy2=2cos(x+y2)+2y(2ysin(x+y2))=2cos(x+y2)4y2sin(x+y2)\frac{\partial^2 f}{\partial y^2} = 2\cos\bigl(x+y^{2}\bigr) + 2y\cdot\bigl(-2y\sin(x+y^{2})\bigr) = 2\cos\bigl(x+y^{2}\bigr) - 4y^{2}\sin\bigl(x+y^{2}\bigr)

The mistake: forgetting the term that comes from the 2y

Writing fyy=4y2sin(x+y2)f_{yy} = -4y^{2}\sin(x+y^{2}) is the standard error. It applies the chain rule to the cosine and never differentiates the 2y2y standing in front. Check it along the xx axis, where y=0y = 0: the true value is 2cosx2\cos x, while the incomplete version gives 00 for every xx, which would wrongly say the surface has no curvature in the yy direction anywhere along that line.

The reverse error also happens, keeping only 2cos(x+y2)2\cos(x+y^{2}) and dropping the chain rule term. Both terms are real, and they compete: near y=0y = 0 the first dominates, while for large y|y| the 4y24y^{2} factor takes over.

Nothing similar happens in the xx direction, because the inner derivative there is the constant 11. That asymmetry is the point of this example: the same outer function can need a product rule in one variable and not in the other.

Relations between the three second partials

Because everything is built from the same inner function, the three answers are tied together.

  • fxx=ff_{xx} = -f, so the xx cross sections are ordinary sine waves.
  • fxy=2yfxxf_{xy} = 2y\,f_{xx}, the mixed partial is the pure xx curvature scaled by the inner derivative 2y2y.
  • fyy=2fx+4y2fxxf_{yy} = 2f_{x} + 4y^{2}f_{xx}, one term from differentiating the 2y2y and one from the chain rule.

Clairaut symmetry holds: differentiating fy=2ycos(x+y2)f_y = 2y\cos(x+y^{2}) in xx leaves the constant 2y2y alone and turns the cosine into sin-\sin, giving 2ysin(x+y2)-2y\sin(x+y^{2}), the same mixed partial found the other way.

The level curves are the parabolas x+y2=cx + y^{2} = c, so the whole surface is one sine wave bent along parabolic ridges. That is why the mixed partial carries a factor of yy: the ridges tilt more steeply the further you go from the xx axis.

Frequently asked questions

Why does only f_yy need the product rule?

Because the inner derivative in yy is 2y2y, which is itself a function of yy, so fy=2ycos(x+y2)f_y = 2y\cos(x+y^2) is a genuine product. The inner derivative in xx is the constant 11, so fx=cos(x+y2)f_x = \cos(x+y^2) has nothing to apply the product rule to.

What is the mixed partial of sin(x + y^2)?

It is 2ysin(x+y2)-2y\sin(x+y^2), in either order. Note that it vanishes on the whole xx axis, where y=0y = 0, so along that line the Hessian is diagonal: the surface has no twist there, only pure curvature sinx-\sin x along xx and 2cosx2\cos x along yy.