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+sinxcosy)f(x,y) = \ln\left(3 + \sin x\cos y\right)
fx=cosxcosy3+sinxcosy\frac{\partial f}{\partial x} = \frac{\cos x\cos y}{3 + \sin x\cos y}
fy=sinxsiny3+sinxcosy\frac{\partial f}{\partial y} = \frac{-\sin x\sin y}{3 + \sin x\cos y}

Logarithm outside, product inside

Write u=3+sinxcosyu = 3 + \sin x\cos y. The logarithm rule gives fx=1uux\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.

ux=cosxcosy,uy=sinxsiny\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.

fx=cosxcosy3+sinxcosy,fy=sinxsiny3+sinxcosy\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=ln31.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 sinxcosy\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 lnu\ln u is uu\frac{u'}{u}, and uu in the denominator is the full inside expression.
  • A second slip is splitting the logarithm as ln3+ln(sinxcosy)\ln 3 + \ln(\sin x\cos y). There is no such rule for a sum inside a logarithm, and sinxcosy\sin x \cos y goes negative anyway.
  • A third is losing the minus sign in the yy partial. It comes from ddycosy=siny\frac{d}{dy}\cos y = -\sin y.

Why the function is defined everywhere

Both sinx\sin x and cosy\cos y live between 1-1 and 11, so their product lives between 1-1 and 11 and the inside 3+sinxcosy3 + \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 cosxcosy=0\cos x\cos y = 0 and sinxsiny=0\sin x\sin y = 0 you cannot have cosx=0\cos x = 0 and sinx=0\sin x = 0 together, so the solutions pair cosx=0\cos x = 0 with siny=0\sin y = 0, or cosy=0\cos y = 0 with sinx=0\sin x = 0. Those are the points where sinxcosy\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 [ln2,ln4][\ln 2, \ln 4], roughly 0.6930.693 to 1.3861.386. The extremes occur where sinxcosy\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.