How to Find the Derivative of the Logistic Function
At a glance
- 1. Write the function
Use the standard sigmoid σ(x) = 1/(1 + e^(−x)).
- 2. Apply the chain rule
Differentiate the reciprocal form, keeping track of the negative exponent.
- 3. Use the identity
Rewrite the result as σ′(x) = σ(x)(1 − σ(x)).
- 4. Handle scaled inputs
For σ(kx + b), multiply by the inner derivative k.
Title: How to Find the Derivative of the Logistic Function Category: mathematics
The standard logistic function, also called the logistic sigmoid, is
Its derivative has a compact form that is especially useful in calculus, statistics, and machine learning: it can be written using the value of the function itself. The same result also makes it straightforward to differentiate logistic curves with scaled or shifted inputs.
Differentiate the standard logistic function
Rewrite the function as a power:
Now apply the chain rule. The outer function is the reciprocal power, and the inner function is :
To express this in terms of , note that
Multiplying by gives the standard identity:
Both expressions are equivalent. The exponential form is useful when you need a formula directly in terms of ; the product form is convenient when the sigmoid value has already been calculated.
Worked example with a scaled input
Suppose a model uses
The input to the sigmoid is , whose derivative is . The chain rule therefore gives
At , the sigmoid’s input is , and . Thus
The factor of is essential. Differentiating only the sigmoid and forgetting to differentiate its input would give a result one-third as large.
Derivative of a general logistic curve
A common shifted and scaled logistic curve is
where sets one asymptotic level, sets the difference between the two asymptotic levels, controls the direction and steepness of the transition, and locates its midpoint. Differentiating gives
Equivalently, in terms of ,
provided . If and are positive, the curve increases from toward . A negative reverses the direction of the transition. This parameterized form is useful because it shows that changing the scale or steepness changes the derivative too; the derivative of the standard sigmoid cannot simply be reused without accounting for those factors.
Where the derivative is largest
For the standard sigmoid, . The product reaches its maximum of when , which occurs at . Therefore
with the maximum slope at the midpoint. Far to the left or right, the sigmoid approaches a horizontal asymptote, so its derivative approaches zero. For the scaled curve above, the maximum slope is when , at .
Common mistakes
- Dropping the chain-rule factor: For , the derivative is , not just the product of sigmoid terms.
- Confusing the function with its derivative: is the derivative, not another expression for .
- Assuming every logistic curve has maximum slope : That value applies to the standard sigmoid. An output scale and input scale change the maximum slope to when both are positive.
- Ignoring the sign of the input scale: A negative makes the curve decrease, so its derivative is negative even though the standard sigmoid’s derivative is positive.
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.