Multivariable calculus

Partials of ln(3 + sin(x)cos(y))

For f(x, y) = the natural log of 3 plus sin(x)cos(y), the partial derivative with respect to x is cos(x)cos(y) divided by 3 plus sin(x)cos(y), and the partial derivative with respect to y is negative sin(x)sin(y) divided by the same quantity. The inside stays between 2 and 4, so the logarithm is always defined.

f(x,y)=ln⁡(3+sin⁡xcos⁡y)f(x,y) = \ln\left(3 + \sin x\cos y\right)
∂f∂x=cos⁡xcos⁡y3+sin⁡xcos⁡y\frac{\partial f}{\partial x} = \frac{\cos x\cos y}{3 + \sin x\cos y}
∂f∂y=−sin⁡xsin⁡y3+sin⁡xcos⁡y\frac{\partial f}{\partial y} = \frac{-\sin x\sin y}{3 + \sin x\cos y}

Logarithm outside, product inside

Write u=3+sin⁡xcos⁡yu = 3 + \sin x\cos y. The logarithm rule gives ∂f∂x=1u∂u∂x\frac{\partial f}{\partial x} = \frac{1}{u}\frac{\partial u}{\partial x}, so the whole job reduces to differentiating the inside, which you already know how to do.

∂u∂x=cos⁡xcos⁡y,∂u∂y=−sin⁡xsin⁡y\frac{\partial u}{\partial x} = \cos x\cos y, \qquad \frac{\partial u}{\partial y} = -\sin x\sin y

Divide each by uu and you have both answers. The constant 33 contributes nothing to the numerators, since the derivative of a constant is zero, but it stays in the denominator because that denominator is the original inside function.

∂f∂x=cos⁡xcos⁡y3+sin⁡xcos⁡y,∂f∂y=−sin⁡xsin⁡y3+sin⁡xcos⁡y\frac{\partial f}{\partial x} = \frac{\cos x\cos y}{3 + \sin x\cos y}, \qquad \frac{\partial f}{\partial y} = \frac{-\sin x\sin y}{3 + \sin x\cos y}

At the origin f=ln⁡3≈1.0986f = \ln 3 \approx 1.0986 and the gradient is (13,0)\left(\frac{1}{3}, 0\right).

The mistake: dropping the 3 from the denominator

The single most common error is writing the denominator as sin⁡xcos⁡y\sin x\cos y, on the reasoning that the 33 differentiates away. It does differentiate away in the numerator, but the denominator is uu itself, untouched by differentiation.

  • The chain rule for ln⁡u\ln u is u′u\frac{u'}{u}, and uu in the denominator is the full inside expression.
  • A second slip is splitting the logarithm as ln⁡3+ln⁡(sin⁡xcos⁡y)\ln 3 + \ln(\sin x\cos y). There is no such rule for a sum inside a logarithm, and sin⁡xcos⁡y\sin x \cos y goes negative anyway.
  • A third is losing the minus sign in the yy partial. It comes from ddycos⁡y=−sin⁡y\frac{d}{dy}\cos y = -\sin y.

Why the function is defined everywhere

Both sin⁡x\sin x and cos⁡y\cos y live between −1-1 and 11, so their product lives between −1-1 and 11 and the inside 3+sin⁡xcos⁡y3 + \sin x\cos y lives between 22 and 44. A logarithm needs a positive argument, and 22 is comfortably positive, so there is no domain restriction to worry about and no denominator that can vanish.

Critical points need both numerators to be zero at once. From cos⁡xcos⁡y=0\cos x\cos y = 0 and sin⁡xsin⁡y=0\sin x\sin y = 0 you cannot have cos⁡x=0\cos x = 0 and sin⁡x=0\sin x = 0 together, so the solutions pair cos⁡x=0\cos x = 0 with sin⁡y=0\sin y = 0, or cos⁡y=0\cos y = 0 with sin⁡x=0\sin x = 0. Those are the points where sin⁡xcos⁡y\sin x \cos y hits ±1\pm 1 or 00, that is the peaks, valleys, and saddles of the surface.

Frequently asked questions

What are the largest and smallest values of the function?

The inside ranges over [2,4][2,4], so ff ranges over [ln⁡2,ln⁡4][\ln 2, \ln 4], roughly 0.6930.693 to 1.3861.386. The extremes occur where sin⁡xcos⁡y\sin x\cos y equals −1-1 or 11.

Does the logarithm change the location of the critical points?

No. Since ln⁡\ln is strictly increasing, ff and its inside function have their maxima and minima at exactly the same points. That is why the numerators of the partials are just the partials of the inside.