Multivariable calculus

Partials of x sin(y) + y cos(x)

For f(x, y) = x sin(y) + y cos(x), the partial derivative with respect to x is sin(y) minus y sin(x), and the partial derivative with respect to y is x cos(y) plus cos(x). Both terms contain both variables, so each term contributes something to each partial.

f(x,y)=xsin⁡y+ycos⁡xf(x,y) = x\sin y + y\cos x
∂f∂x=sin⁡y−ysin⁡x\frac{\partial f}{\partial x} = \sin y - y\sin x
∂f∂y=xcos⁡y+cos⁡x\frac{\partial f}{\partial y} = x\cos y + \cos x

Term by term, with the roles swapping

Take ∂f∂x\frac{\partial f}{\partial x} first. In the term xsin⁡yx\sin y the moving variable sits in the front factor, so its derivative is sin⁡y\sin y. In the term ycos⁡xy\cos x the moving variable sits inside the cosine, so yy is the constant multiplier and you get −ysin⁡x-y\sin x.

∂f∂x=sin⁡y−ysin⁡x\frac{\partial f}{\partial x} = \sin y - y\sin x

Now ∂f∂y\frac{\partial f}{\partial y}. The roles reverse: xsin⁡yx\sin y has xx as the multiplier and gives xcos⁡yx\cos y, while ycos⁡xy\cos x has cos⁡x\cos x as the multiplier and gives cos⁡x\cos x.

∂f∂y=xcos⁡y+cos⁡x\frac{\partial f}{\partial y} = x\cos y + \cos x

Notice that each partial keeps one piece of each term. That is the signature of a function where the variables genuinely interact.

The mistake: assuming a term drops out

When a term visibly contains the other variable, students often discard it. Here ycos⁡xy\cos x contains yy, but it also contains xx, so it survives ∂f∂x\frac{\partial f}{\partial x} as −ysin⁡x-y\sin x. A term only disappears when the moving variable is completely absent from it.

  • Scan each term for the moving variable before deciding anything.
  • If the moving variable is present, differentiate that term and keep the rest as a constant multiplier.
  • If it is absent, and only then, the term contributes zero.

A second slip is losing the minus sign on −ysin⁡x-y\sin x. It comes from ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x, not from anything about yy.

Linearisation at the origin

Evaluate everything at (0,0)(0,0). The function value is 0⋅sin⁡0+0⋅cos⁡0=00\cdot\sin 0 + 0\cdot\cos 0 = 0. The partials are sin⁡0−0⋅sin⁡0=0\sin 0 - 0\cdot\sin 0 = 0 and 0⋅cos⁡0+cos⁡0=10\cdot\cos 0 + \cos 0 = 1.

L(x,y)=f(0,0)+∂f∂x(0,0) x+∂f∂y(0,0) y=yL(x,y) = f(0,0) + \frac{\partial f}{\partial x}(0,0)\,x + \frac{\partial f}{\partial y}(0,0)\,y = y

So near the origin the surface behaves like the plane z=yz = y. Test it at (0.1,0.1)(0.1, 0.1): the true value is 0.1sin⁡(0.1)+0.1cos⁡(0.1)≈0.10950.1\sin(0.1) + 0.1\cos(0.1) \approx 0.1095, and the linear estimate is 0.10.1. The error is about 0.00950.0095, roughly the size you expect from a quadratic correction at that scale.

Frequently asked questions

Do the mixed partials agree?

Yes. Differentiating sin⁡y−ysin⁡x\sin y - y\sin x by yy gives cos⁡y−sin⁡x\cos y - \sin x, and differentiating xcos⁡y+cos⁡xx\cos y + \cos x by xx gives cos⁡y−sin⁡x\cos y - \sin x. The function is smooth, so Clairaut's theorem applies.

Is the origin a critical point?

No. The gradient there is (0,1)(0,1), which is not the zero vector, so the surface has a genuine slope in the yy direction and cannot have a maximum, minimum, or saddle at that point.