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)=xsiny+ycosxf(x,y) = x\sin y + y\cos x
fx=sinyysinx\frac{\partial f}{\partial x} = \sin y - y\sin x
fy=xcosy+cosx\frac{\partial f}{\partial y} = x\cos y + \cos x

Term by term, with the roles swapping

Take fx\frac{\partial f}{\partial x} first. In the term xsinyx\sin y the moving variable sits in the front factor, so its derivative is siny\sin y. In the term ycosxy\cos x the moving variable sits inside the cosine, so yy is the constant multiplier and you get ysinx-y\sin x.

fx=sinyysinx\frac{\partial f}{\partial x} = \sin y - y\sin x

Now fy\frac{\partial f}{\partial y}. The roles reverse: xsinyx\sin y has xx as the multiplier and gives xcosyx\cos y, while ycosxy\cos x has cosx\cos x as the multiplier and gives cosx\cos x.

fy=xcosy+cosx\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 ycosxy\cos x contains yy, but it also contains xx, so it survives fx\frac{\partial f}{\partial x} as ysinx-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 ysinx-y\sin x. It comes from ddxcosx=sinx\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 0sin0+0cos0=00\cdot\sin 0 + 0\cdot\cos 0 = 0. The partials are sin00sin0=0\sin 0 - 0\cdot\sin 0 = 0 and 0cos0+cos0=10\cdot\cos 0 + \cos 0 = 1.

L(x,y)=f(0,0)+fx(0,0)x+fy(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 sinyysinx\sin y - y\sin x by yy gives cosysinx\cos y - \sin x, and differentiating xcosy+cosxx\cos y + \cos x by xx gives cosysinx\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.