Multivariable calculus

Partial Derivatives of e^(xy) cos y

For f(x,y) = e^(xy) cos y, the partial with respect to x is y e^(xy) cos y, and the partial with respect to y is e^(xy) times (x cos y - sin y). Only the y-partial needs the product rule, because cos y is constant when x is the moving variable.

f(x,y)=exycosyf(x,y) = e^{xy}\cos y
fx=yexycosy\frac{\partial f}{\partial x} = y e^{xy}\cos y
fy=exy(xcosysiny)\frac{\partial f}{\partial y} = e^{xy}\left(x\cos y - \sin y\right)

Decide which factors are alive

This is the cleanest example of a rule that saves time: before differentiating, list which factors actually contain the variable you are moving. In xx, only exye^{xy} contains xx, so cosy\cos y is a constant multiplier and the product rule is not needed.

fx=cosyxexy=yexycosy\frac{\partial f}{\partial x} = \cos y \cdot \frac{\partial}{\partial x}e^{xy} = y e^{xy}\cos y

In yy, both factors are alive: exye^{xy} depends on yy through the exponent and cosy\cos y obviously does. Now the product rule is unavoidable.

fy=xexycosy+exy(siny)\frac{\partial f}{\partial y} = x e^{xy}\cos y + e^{xy}(-\sin y)

Factor the common exye^{xy} out. The exponential is never zero, so the factored form immediately tells you the yy-partial vanishes exactly when xcosy=sinyx\cos y = \sin y, that is when tany=x\tan y = x.

fy=exy(xcosysiny)\frac{\partial f}{\partial y} = e^{xy}\left(x\cos y - \sin y\right)

The mistake: sign and chain rule slips in the y-partial

Two errors dominate here. The first is writing +siny+\sin y instead of siny-\sin y, because the derivative of cosine carries the minus sign. The second is writing exye^{xy} for the derivative of exye^{xy} in yy, forgetting that the chain rule brings down the inner derivative xx.

  • yexy=xexy\frac{\partial}{\partial y}e^{xy} = x e^{xy}, not exye^{xy} and not yexyy e^{xy}.
  • xexy=yexy\frac{\partial}{\partial x}e^{xy} = y e^{xy}. The coefficient is always the other variable.
  • ddycosy=siny\frac{d}{dy}\cos y = -\sin y. The minus sign is what makes the two terms compete rather than reinforce.

A structural check: the xx-partial must contain cosy\cos y untouched, because a constant factor passes straight through differentiation. If your xx-partial has a siny\sin y in it, you differentiated a factor that was supposed to be frozen.

A point where the two partials disagree

At (1,0)(1,0) the exponential is e0=1e^{0}=1, cos0=1\cos 0 = 1, and sin0=0\sin 0 = 0. The xx-partial picks up the factor y=0y = 0 and dies; the yy-partial survives.

fx(1,0)=0,fy(1,0)=1\frac{\partial f}{\partial x}(1,0) = 0, \qquad \frac{\partial f}{\partial y}(1,0) = 1

This is a good reminder that a partial derivative can be zero without anything special happening to the function. Along the line y=0y = 0 the function is constantly 1, so of course moving in xx changes nothing there.

Frequently asked questions

Why does the x-partial have no sine term?

Because cosy\cos y does not depend on xx. When you differentiate with respect to xx, that factor behaves like a fixed number and comes along unchanged. Sine only appears when you differentiate cosy\cos y, which happens only in the yy-partial.

Where does the gradient vanish?

The xx-partial yexycosyy e^{xy}\cos y is zero when y=0y = 0 or cosy=0\cos y = 0. On the line y=0y = 0 the yy-partial reduces to e0(x10)=xe^{0}(x \cdot 1 - 0) = x, which is zero only at x=0x = 0. On the branch where cosy=0\cos y = 0 the yy-partial is exysiny-e^{xy}\sin y, and siny=±1\sin y = \pm 1 there, so it never vanishes. The origin is the only critical point.