Multivariable calculus

Critical Points of sin(x+y) + cos(x-y)

The critical points of f(x,y) = sin(x+y) + cos(x-y) sit where cos(x+y) = 0 and sin(x-y) = 0. The discriminant there is D = 4 sin(x+y) cos(x-y). The point (pi/4, pi/4) is a local maximum with D = 4 and value 2, (3pi/4, -pi/4) is a saddle with D = -4, and (5pi/4, pi/4) is a local minimum with D = 4.

f(x,y)=sin(x+y)+cos(xy)f(x,y) = \sin(x+y) + \cos(x-y)
  • (0.7853981633974483,0.7853981633974483)\left(0.7853981633974483, 0.7853981633974483\right) local maximumdiscriminant D = 4
  • (2.356194490192345,0.7853981633974483)\left(2.356194490192345, -0.7853981633974483\right) saddle pointdiscriminant D = -4
  • (3.9269908169872414,0.7853981633974483)\left(3.9269908169872414, 0.7853981633974483\right) local minimumdiscriminant D = 4

These are not necessarily all of them; the page says which it covers.

Add and subtract to decouple the system

The chain rule contributes an inside derivative of +1+1 to sin(x+y)\sin(x+y) in both variables, but cos(xy)\cos(x-y) contributes +1+1 in xx and 1-1 in yy. That single sign difference is what makes the system solvable.

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

Add the two equations and the sine cancels. Subtract them and the cosine cancels. Two combinations replace a coupled pair with two independent conditions.

cos(x+y)=0andsin(xy)=0\cos(x+y) = 0 \qquad \text{and} \qquad \sin(x-y) = 0

Writing u=x+yu = x+y and v=xyv = x-y, the critical points are exactly the places where u=π2+mπu = \frac{\pi}{2} + m\pi and v=nπv = n\pi. Solving back gives x=u+v2x = \frac{u+v}{2} and y=uv2y = \frac{u-v}{2}, which is an infinite grid rotated 45 degrees relative to the axes.

  • u=π2u = \frac{\pi}{2}, v=0v = 0 gives (π4,π4)\left(\frac{\pi}{4}, \frac{\pi}{4}\right).
  • u=π2u = \frac{\pi}{2}, v=πv = \pi gives (3π4,π4)\left(\frac{3\pi}{4}, -\frac{\pi}{4}\right).
  • u=3π2u = \frac{3\pi}{2}, v=πv = \pi gives (5π4,π4)\left(\frac{5\pi}{4}, \frac{\pi}{4}\right).

The discriminant in closed form

Differentiate once more. Write S=sin(x+y)S = \sin(x+y) and C=cos(xy)C = \cos(x-y) to keep the algebra readable.

fxx=SC,fyy=SC,fxy=S+Cf_{xx} = -S - C, \qquad f_{yy} = -S - C, \qquad f_{xy} = -S + C

The two diagonal entries are equal, so the discriminant is a difference of two squares and it collapses.

D=(S+C)2(CS)2=4SC=4sin(x+y)cos(xy)D = (S+C)^{2} - (C-S)^{2} = 4SC = 4\sin(x+y)\cos(x-y)

At a critical point cos(x+y)=0\cos(x+y) = 0 forces S=±1S = \pm 1, and sin(xy)=0\sin(x-y) = 0 forces C=±1C = \pm 1. So DD is always +4+4 or 4-4 and the test never stalls. When SS and CC have the same sign, D=4D = 4 and fxx=(S+C)f_{xx} = -(S+C) settles it: both equal to +1+1 gives fxx=2f_{xx} = -2 and a local maximum, both equal to 1-1 gives fxx=2f_{xx} = 2 and a local minimum. When SS and CC have opposite signs, D=4D = -4 and the point is a saddle.

That reads off the three listed points immediately. At (π4,π4)\left(\frac{\pi}{4}, \frac{\pi}{4}\right), S=C=1S = C = 1 so fxx=2f_{xx} = -2 and f=2f = 2, the global maximum. At (3π4,π4)\left(\frac{3\pi}{4}, -\frac{\pi}{4}\right), S=1S = 1 and C=1C = -1 so fxx=0f_{xx} = 0, fxy=2f_{xy} = -2, and D=4D = -4. At (5π4,π4)\left(\frac{5\pi}{4}, \frac{\pi}{4}\right), S=C=1S = C = -1 so fxx=2f_{xx} = 2 and f=2f = -2, the global minimum.

The mistake students make

The inside derivative of cos(xy)\cos(x-y) is where most of the errors live, because it is +1+1 in one variable and 1-1 in the other. Write the chain rule out in full rather than pattern matching.

xcos(xy)=sin(xy)(1),ycos(xy)=sin(xy)(1)=+sin(xy)\frac{\partial}{\partial x}\cos(x-y) = -\sin(x-y)\cdot(1), \qquad \frac{\partial}{\partial y}\cos(x-y) = -\sin(x-y)\cdot(-1) = +\sin(x-y)

That opposite pair of signs is the only difference between fxf_x and fyf_y, and it is exactly what makes adding and subtracting productive. Get it wrong and the two partials come out identical, both combinations collapse to the same equation, and the system looks unsolvable.

There is a free check available. ff is symmetric: swapping xx and yy leaves sin(x+y)\sin(x+y) alone and turns cos(xy)\cos(x-y) into cos(yx)\cos(y-x), which is the same number because cosine is even. A symmetric function must satisfy fy(x,y)=fx(y,x)f_y(x,y) = f_x(y,x), and the stated partials do, since swapping the variables in cos(x+y)sin(xy)\cos(x+y) - \sin(x-y) flips the sine and gives cos(x+y)+sin(xy)\cos(x+y) + \sin(x-y). If your two partials fail that test, one inside derivative has the wrong sign.

The second slip is assuming fxx=0f_{xx} = 0 means the test is inconclusive at (3π4,π4)\left(\frac{3\pi}{4}, -\frac{\pi}{4}\right). The discriminant is what decides, and here D=fxy2=4D = -f_{xy}^{2} = -4, comfortably negative. A vanishing diagonal entry with a nonzero mixed partial is the signature of a saddle, not of a degenerate point.

Frequently asked questions

Why does the substitution u = x + y, v = x - y help so much?

Because ff is genuinely a function of uu and vv alone: f=sinu+cosvf = \sin u + \cos v, which is separable. In those coordinates the critical point conditions are just cosu=0\cos u = 0 and sinv=0\sin v = 0, one variable each. The change of variables is a rotation and a rescaling, so it does not create or destroy critical points, and the classification transfers.

Is the list of three points complete?

No. The conditions cos(x+y)=0\cos(x+y) = 0 and sin(xy)=0\sin(x-y) = 0 each have infinitely many solutions, so the critical points form an infinite grid. The three listed here are one representative of each behaviour. Every other critical point is a copy: shift x+yx+y by 2π2\pi or xyx-y by 2π2\pi and both the discriminant and the classification come back unchanged.