Multivariable calculus

Partial Derivatives of y^2 cos(xy)

For f(x, y) = y squared times cos(xy), the partial derivative with respect to x is negative y cubed times sin(xy), and the partial derivative with respect to y is 2y cos(xy) minus x y squared times sin(xy). The x partial needs only the chain rule; the y partial needs the product rule and the chain rule together.

f(x,y)=y2cos(xy)f(x,y) = y^2\cos(xy)
fx=y3sin(xy)\frac{\partial f}{\partial x} = -y^3\sin(xy)
fy=2ycos(xy)xy2sin(xy)\frac{\partial f}{\partial y} = 2y\cos(xy) - xy^2\sin(xy)

The easy partial and the hard one

With yy fixed, the factor y2y^2 is a constant and only the cosine moves. The chain rule gives sin(xy)-\sin(xy) times the inside derivative yy, and the leading y2y^2 multiplies through.

fx=y2(sin(xy))y=y3sin(xy)\frac{\partial f}{\partial x} = y^2\cdot\left(-\sin(xy)\right)\cdot y = -y^3\sin(xy)

With xx fixed, both factors contain yy, so the product rule is unavoidable. Differentiate y2y^2 to get 2y2y, keep cos(xy)\cos(xy), then keep y2y^2 and differentiate cos(xy)\cos(xy) by yy, which brings out sin(xy)-\sin(xy) times the inside derivative xx.

fy=2ycos(xy)+y2(xsin(xy))=2ycos(xy)xy2sin(xy)\frac{\partial f}{\partial y} = 2y\cos(xy) + y^2\cdot\left(-x\sin(xy)\right) = 2y\cos(xy) - xy^2\sin(xy)

At (0,2)(0,2) the inside is zero, so fx=8sin0=0\frac{\partial f}{\partial x} = -8\sin 0 = 0 and fy=4cos00=4\frac{\partial f}{\partial y} = 4\cos 0 - 0 = 4.

The mistake: using the same rule for both variables

Because the yy partial needs a product rule, students often add a spurious product rule term to the xx partial, tacking an extra piece onto y3sin(xy)-y^3\sin(xy). There is nothing to add: y2y^2 has zero derivative with respect to xx, so that branch of the product rule contributes zero.

  • The number of terms in a partial derivative depends on how many factors carry the moving variable, not on how the function looks overall.
  • Here xx appears in one factor, so fx\frac{\partial f}{\partial x} has one term. yy appears in two factors, so fy\frac{\partial f}{\partial y} has two.
  • Watch the exponent: y2y^2 times the inside derivative yy gives y3y^3, not y2y^2.

Checking with Clairaut's theorem

A good way to catch an error in either partial is to compute the mixed second derivative both ways and see whether they match. Starting from fx=y3sin(xy)\frac{\partial f}{\partial x} = -y^3\sin(xy) and differentiating by yy, the product rule gives 3y2sin(xy)xy3cos(xy)-3y^2\sin(xy) - xy^3\cos(xy).

Starting instead from fy=2ycos(xy)xy2sin(xy)\frac{\partial f}{\partial y} = 2y\cos(xy) - xy^2\sin(xy) and differentiating by xx, you get 2y2sin(xy)y2sin(xy)xy3cos(xy)-2y^2\sin(xy) - y^2\sin(xy) - xy^3\cos(xy), and the first two terms combine to 3y2sin(xy)-3y^2\sin(xy).

2fyx=2fxy=3y2sin(xy)xy3cos(xy)\frac{\partial^2 f}{\partial y\,\partial x} = \frac{\partial^2 f}{\partial x\,\partial y} = -3y^2\sin(xy) - xy^3\cos(xy)

They agree, as they must for a smooth function. If your two routes had disagreed, one of the first partials would have been wrong.

Frequently asked questions

Why is the x partial zero along the whole x axis?

On the line y=0y = 0 the factor y3-y^3 is zero, so fx=0\frac{\partial f}{\partial x} = 0 there. That matches the function itself, which is identically zero along y=0y = 0 and therefore flat in the xx direction.

Where do both partials vanish at once?

Setting y=0y = 0 makes both zero, so the entire xx axis consists of critical points. Away from that line, y3sin(xy)=0-y^3\sin(xy) = 0 forces sin(xy)=0\sin(xy) = 0, and substituting into the second partial leaves 2ycos(xy)02y\cos(xy) \neq 0.