Multivariable calculus

Partial Derivatives of sin^2(x) + cos^2(y)

For f(x, y) = sin squared of x plus cos squared of y, the partial derivative with respect to x is 2 sin(x)cos(x), which equals sin(2x), and the partial derivative with respect to y is negative 2 cos(y)sin(y), which equals negative sin(2y). Each term contains only one variable, so each partial sees just one term.

f(x,y)=sin⁡2x+cos⁡2yf(x,y) = \sin^2 x + \cos^2 y
∂f∂x=2sin⁡xcos⁡x=sin⁡2x\frac{\partial f}{\partial x} = 2\sin x\cos x = \sin 2x
∂f∂y=−2cos⁡ysin⁡y=−sin⁡2y\frac{\partial f}{\partial y} = -2\cos y\sin y = -\sin 2y

Separated variables make each partial a one term job

The function is a sum where the first term has only xx and the second only yy. Differentiating with respect to xx kills cos⁡2y\cos^2 y outright, since a term with no xx in it is a constant.

∂f∂x=ddx(sin⁡x)2=2sin⁡xcos⁡x=sin⁡2x\frac{\partial f}{\partial x} = \frac{d}{dx}\left(\sin x\right)^2 = 2\sin x\cos x = \sin 2x

The power rule supplies the factor 2sin⁡x2\sin x and the chain rule supplies cos⁡x\cos x. The same structure on the other term gives 2cos⁡y2\cos y times the derivative of cosine, which is where the minus sign comes from.

∂f∂y=2cos⁡y⋅(−sin⁡y)=−sin⁡2y\frac{\partial f}{\partial y} = 2\cos y\cdot(-\sin y) = -\sin 2y

At (π4,π4)\left(\frac{\pi}{4}, \frac{\pi}{4}\right) the partials are sin⁡π2=1\sin\frac{\pi}{2} = 1 and −sin⁡π2=−1-\sin\frac{\pi}{2} = -1, so the surface rises in xx and falls in yy at the same rate.

The mistake: reaching for sin^2 + cos^2 = 1

The Pythagorean identity needs the same angle in both terms. Here the arguments are xx and yy, so sin⁡2x+cos⁡2y\sin^2 x + \cos^2 y is not 11 and the function is not constant. At x=0x = 0, y=0y = 0 it equals 11, but at x=π2x = \frac{\pi}{2}, y=0y = 0 it equals 22, and at x=0x = 0, y=π2y = \frac{\pi}{2} it equals 00.

  • Check the arguments match before applying any trigonometric identity.
  • The values of this function fill the range from 00 to 22, so it is far from constant.
  • If the identity did apply, ff would be constant and both partials would be zero everywhere, yet ∂f∂x=1\frac{\partial f}{\partial x} = 1 at (π4,π4)\left(\frac{\pi}{4},\frac{\pi}{4}\right).

Critical points and the mixed partial

Both partials vanish when sin⁡2x=0\sin 2x = 0 and sin⁡2y=0\sin 2y = 0, that is when xx and yy are integer multiples of π2\frac{\pi}{2}. The critical points form a lattice across the plane.

Because no term contains both variables, the mixed partial is zero everywhere: ∂2f∂x ∂y=0\frac{\partial^2 f}{\partial x\,\partial y} = 0. That makes the second derivative test easy, since the discriminant is just ∂2f∂x2⋅∂2f∂y2\frac{\partial^2 f}{\partial x^2}\cdot\frac{\partial^2 f}{\partial y^2} with ∂2f∂x2=2cos⁡2x\frac{\partial^2 f}{\partial x^2} = 2\cos 2x and ∂2f∂y2=−2cos⁡2y\frac{\partial^2 f}{\partial y^2} = -2\cos 2y.

At (0,0)(0,0) that gives 2⋅(−2)=−4<02 \cdot (-2) = -4 < 0, so the origin is a saddle. Minimum in one direction, maximum in the other, which is exactly what a sum of two independent oscillations produces.

Frequently asked questions

Is sin^2(x) the same as sin(x^2)?

No. sin⁡2x\sin^2 x means (sin⁡x)2(\sin x)^2, while sin⁡(x2)\sin(x^2) squares the input first. Their derivatives differ too: 2sin⁡xcos⁡x2\sin x\cos x against 2xcos⁡(x2)2x\cos(x^2).

Why write the answers as sin(2x) and negative sin(2y)?

The double angle identity sin⁡2θ=2sin⁡θcos⁡θ\sin 2\theta = 2\sin\theta\cos\theta compresses each answer into one term, which makes the zeros easy to read off and the second derivatives quicker to take.