Multivariable calculus

Partial Derivatives of cos(x - y^2)

The partials of cos(x - y^2) are f_x = -sin(x - y^2) and f_y = 2y sin(x - y^2). The outer cosine differentiates to minus sine both times. For x the inner partial is 1, and for y it is -2y, whose minus cancels the one from the cosine, so f_y comes out positive.

f(x,y)=cos(xy2)f(x,y) = \cos(x - y^2)
fx=sin(xy2)\frac{\partial f}{\partial x} = -\sin(x - y^2)
fy=2ysin(xy2)\frac{\partial f}{\partial y} = 2y\sin(x - y^2)

Track the two minus signs separately

Let u=xy2u = x - y^2. The outer derivative is sinu-\sin u every time. The inner partials are ux=1\frac{\partial u}{\partial x} = 1 and uy=2y\frac{\partial u}{\partial y} = -2y, and it is worth writing both down before multiplying.

fx=sin(xy2)1=sin(xy2)\frac{\partial f}{\partial x} = -\sin(x - y^2)\cdot 1 = -\sin(x - y^2)
fy=sin(xy2)(2y)=2ysin(xy2)\frac{\partial f}{\partial y} = -\sin(x - y^2)\cdot(-2y) = 2y\sin(x - y^2)

Doing the two steps on paper rather than in your head is the whole technique. Sign errors here come from combining the outer and inner derivatives in one mental move.

The mistake: one minus sign instead of two

The usual wrong answer is 2ysin(xy2)-2y\sin(x - y^2), which applies the cosine's minus but forgets that y2-y^2 already carries one of its own. Test it at x=0x = 0, y=1y = 1: there u=1u = -1 and sin(1)=0.8415\sin(-1) = -0.8415, so the true fy=2(0.8415)=1.683f_y = 2(-0.8415) = -1.683 while the wrong version gives +1.683+1.683.

A different error is pulling the subtraction outside and writing cosxcosy2\cos x - \cos y^2. The cosine of a difference is not the difference of cosines, and the two disagree almost everywhere: at x=0x = 0, y=1y = 1 the true ff is cos(1)=0.5403\cos(-1) = 0.5403 while the split version gives 1cos1=0.45971 - \cos 1 = 0.4597.

Parabolic level curves and a degenerate critical set

The function is constant wherever xy2x - y^2 is constant, so its level curves are the sideways parabolas x=y2+cx = y^2 + c. The gradient (sinu, 2ysinu)(-\sin u,\ 2y\sin u) sits perpendicular to those parabolas.

Both partials vanish exactly when sin(xy2)=0\sin(x - y^2) = 0, that is on the whole family of parabolas xy2=kπx - y^2 = k\pi. These are curves of critical points rather than isolated points, and the discriminant fxxfyyfxy2f_{xx}f_{yy} - f_{xy}^2 works out to zero along every one of them, so the second derivative test is degenerate and the shape of the cosine has to do the classifying.

Frequently asked questions

Why does the y partial contain a factor of y but the x partial does not?

Because yy enters through y2y^2 while xx enters linearly. The inner partial with respect to xx is the constant 11, so nothing extra appears, whereas with respect to yy it is 2y-2y, which carries the variable into the answer.

Are there any isolated critical points?

No. Both partials are zero exactly where sin(xy2)=0\sin(x - y^2) = 0, which is a family of parabolas, not a set of isolated points. Each parabola is a ridge or a trough of the surface, at height +1+1 or 1-1.