Multivariable calculus

Partial Derivatives of sin(x + 2y)

For f(x, y) = sin(x + 2y), the partial derivative with respect to x is cos(x + 2y), and the partial derivative with respect to y is 2 cos(x + 2y). Both partials share the same cosine because the inside is the same; only the inside derivative differs, and it is 1 for x and 2 for y.

f(x,y)=sin(x+2y)f(x,y) = \sin(x + 2y)
fx=cos(x+2y)\frac{\partial f}{\partial x} = \cos(x + 2y)
fy=2cos(x+2y)\frac{\partial f}{\partial y} = 2\cos(x + 2y)

A linear inside makes the chain rule easy

Let u=x+2yu = x + 2y. Since uu is linear, its partials are constants: ux=1\frac{\partial u}{\partial x} = 1 and uy=2\frac{\partial u}{\partial y} = 2. The outside derivative is cosu\cos u in both cases.

fx=cos(x+2y)1,fy=cos(x+2y)2\frac{\partial f}{\partial x} = \cos(x+2y)\cdot 1, \qquad \frac{\partial f}{\partial y} = \cos(x+2y)\cdot 2

So fy\frac{\partial f}{\partial y} is exactly twice fx\frac{\partial f}{\partial x} at every point. At the origin they are 11 and 22. Moving in yy changes the phase twice as fast as moving in xx, so the surface is twice as steep in that direction.

The mistake: putting the 2 in the wrong place

The two wrong answers you see most are cos(x+2y)2y\cos(x + 2y)\cdot 2y, which differentiates the inside as if it were a product, and cos(2x+2y)\cos(2x + 2y), which moves the coefficient inside the cosine. The inside function is not touched by differentiation, only evaluated.

  • The inside stays x+2yx + 2y in every answer. Only the multiplier out front can change.
  • The multiplier is the partial derivative of the inside, and y(x+2y)=2\frac{\partial}{\partial y}(x + 2y) = 2, not 2y2y.
  • Sanity check by restricting to x=0x = 0: the function is sin(2y)\sin(2y), whose derivative is 2cos(2y)2\cos(2y), and setting x=0x = 0 in 2cos(x+2y)2\cos(x+2y) gives the same.

A wave moving through the plane

The level curves are the lines x+2y=cx + 2y = c, and the function is a wave crest sliding along the direction (1,2)(1,2). Differentiating twice gives 2fx2=sin(x+2y)\frac{\partial^2 f}{\partial x^2} = -\sin(x+2y) and 2fy2=4sin(x+2y)\frac{\partial^2 f}{\partial y^2} = -4\sin(x+2y), so the second derivatives are locked together.

2fy2=42fx2\frac{\partial^2 f}{\partial y^2} = 4\,\frac{\partial^2 f}{\partial x^2}

Reading yy as time, this is the wave equation with speed 22: a crest sits where x+2y=cx + 2y = c, so each unit of yy moves it two units in the negative xx direction. Every function of the form g(x+2y)g(x + 2y) satisfies the same relation, which is how you recognise a travelling wave from its partial derivatives alone.

Frequently asked questions

Why do both partials have the same cosine factor?

Because the chain rule evaluates the outside derivative at the same inside value x+2yx + 2y no matter which variable you differentiate by. Only the inside derivative, 11 or 22, distinguishes them.

Is the gradient constant in direction?

Yes. f=cos(x+2y)(1,2)\nabla f = \cos(x+2y)\,(1,2), so the gradient always points along (1,2)(1,2) or against it. It reverses sign where the cosine does, which is at the crests and troughs.