Multivariable calculus

Partial Derivatives of ln(e^x + e^y)

For f(x, y) = ln(e^x + e^y), the partial with respect to x is e^x/(e^x + e^y) and the partial with respect to y is e^y/(e^x + e^y). Both lie strictly between 0 and 1 and they add to exactly 1, so the function increases in every coordinate direction.

ln ⁣(ex+ey)\ln\!\left(e^{x}+e^{y}\right)
exex+ey\frac{e^{x}}{e^{x}+e^{y}}
eyex+ey\frac{e^{y}}{e^{x}+e^{y}}

One logarithm, one frozen exponential

Set u=ex+eyu = e^{x}+e^{y} and use xln(u)=uxu\frac{\partial}{\partial x}\ln(u) = \frac{u_x}{u}. When xx moves, eye^{y} is a constant with derivative 00, so ux=exu_x = e^{x} and only the first term survives in the numerator.

fx=exex+ey,fy=eyex+ey\frac{\partial f}{\partial x} = \frac{e^{x}}{e^{x}+e^{y}}, \qquad \frac{\partial f}{\partial y} = \frac{e^{y}}{e^{x}+e^{y}}

At (0,0)(0,0) both partials are 12\frac{1}{2} and the height is ln20.693\ln 2 \approx 0.693. At (1,0)(1,0) they are ee+10.731\frac{e}{e+1} \approx 0.731 and 1e+10.269\frac{1}{e+1} \approx 0.269: the larger input takes the larger share of the slope.

The mistake: turning a log of a sum into a sum of logs

  • ln(ex+ey)\ln(e^{x}+e^{y}) is not x+yx + y. That would be ln(exey)\ln(e^{x}e^{y}), a product rather than a sum, and it would make both partials equal 11.
  • Writing fx=ex+eyex+ey=1\frac{\partial f}{\partial x} = \frac{e^{x}+e^{y}}{e^{x}+e^{y}} = 1 differentiates eye^{y} as though yy moved too. Only exe^{x} belongs in the numerator of the xx partial.

There is a clean check on the diagonal. Since ex+ex=2exe^{x}+e^{x} = 2e^{x}, the function reduces to f(x,x)=x+ln2f(x,x) = x + \ln 2, a plane of slope 11 along that line. The two partials there are 12\frac{1}{2} each, and they add to the 11 you see.

Why the two partials add to one

fx+fy=ex+eyex+ey=1\frac{\partial f}{\partial x} + \frac{\partial f}{\partial y} = \frac{e^{x}+e^{y}}{e^{x}+e^{y}} = 1

The sum is 11 at every point, so the two slopes are weights that trade against each other. When one input dominates, its weight runs to 11 and the other to 00: at (3,0)(3,0) the xx partial is already about 0.9530.953.

That is the sense in which this log-sum-exp function is a smooth maximum. It stays between max(x,y)\max(x,y) and max(x,y)+ln2\max(x,y)+\ln 2, and its partials switch smoothly between 00 and 11 instead of jumping the way the slopes of max(x,y)\max(x,y) do along y=xy = x. Neither partial is ever zero, so the surface has no critical point.

Frequently asked questions

Why is ln(e^x + e^y) called a smooth maximum?

Because it never differs from max(x, y) by more than ln 2, about 0.693, and its partials move continuously from 0 to 1 as the two inputs trade places, where max(x, y) has a crease along the line y = x.

Is either partial ever zero?

No. Both exponentials are positive, so each partial lies strictly between 0 and 1. The gradient is never the zero vector, which means this function has no critical points anywhere.