Multivariable calculus
Partial Derivatives of ln(1 + e^(xy))
For f(x, y) = ln(1 + e^(xy)), the partial with respect to x is y e^(xy)/(1 + e^(xy)) and the partial with respect to y is x e^(xy)/(1 + e^(xy)). The chain rule runs twice, once for the logarithm and once for the exponent xy.
Peel the layers from the outside in
There are three layers: a logarithm, then , then the exponent . Work outward to inward. With , the logarithm gives , and needs the chain rule once more, on with held fixed.
At the exponent is , so and the partial is while the partial is . At the partial is .
The mistake: stopping after one chain rule
- Writing keeps the inside derivative of the exponent but forgets that itself belongs in the numerator, since .
- Writing stops one layer too early and never differentiates the exponent , so the factor is missing.
- Writing applies only the logarithm rule and skips both inner steps.
Pick a point where the wrong versions separate from the right one. At the correct partial is about , while the version that skips the exponent gives about , exactly half. A single well-chosen test point catches this.
The softplus and its logistic slope
Write . Then , the softplus function, and its one-variable derivative is the logistic function, because dividing the numerator and denominator by turns into .
That factor is always between and , so the size of each partial is controlled by the frozen variable out front. The gradient vanishes only at the origin, where both and are zero, and the argument is always greater than , so nothing here is ever undefined.
Frequently asked questions
Is ln(1 + e^(xy)) ever undefined?
No. The term e^(xy) is positive, so the argument 1 + e^(xy) is always greater than 1 and the logarithm is defined at every point, along with both partial derivatives.
Why does the logistic function appear in the answer?
Because the factor e^(xy)/(1 + e^(xy)) equals 1/(1 + e^(-xy)), which is the logistic sigmoid. It is the derivative of the softplus function ln(1 + e^t) evaluated at t = xy.