What Is the Derivative of the Sigmoid Function?
At a glance
- 1. Identify the sigmoid
Use the logistic sigmoid, defined as one divided by one plus e to the negative x.
- 2. Differentiate
Apply the chain rule to obtain the exponential form of the derivative.
- 3. Rewrite the result
Express the derivative compactly as the sigmoid value times one minus that value.
- 4. Apply the chain rule
For a sigmoid of an inner function, multiply by the derivative of that inner function.
The derivative of the logistic sigmoid has a particularly simple form: it equals the sigmoid’s value multiplied by one minus that value. This identity is useful for differentiating sigmoid expressions and for computing gradients in models such as neural networks.
The logistic sigmoid
The logistic sigmoid is the function
It maps every real input to a value strictly between 0 and 1. In some fields, “sigmoid” is used more broadly for any S-shaped function, but this logistic function is the standard meaning in many calculus and machine-learning contexts.
Deriving the derivative
Write the sigmoid as a power of its denominator and apply the chain rule:
This is already a correct derivative. To express it in terms of the sigmoid itself, note that
Multiplying this by gives the derivative:
The two derivative forms are equivalent. Use the exponential form when you want a formula directly in terms of , or the compact form when you already know the sigmoid’s output.
Applying the chain rule
If the sigmoid takes an inner function as its input, differentiate both the outer sigmoid and the inner function:
For example, if , then the inner function has derivative , so
More generally, for , the derivative is . The factor is essential: it comes from differentiating the input, not from the sigmoid itself.
For a neural-network unit with and output , the derivative with respect to is . By the chain rule, the gradient with respect to the input vector is .
Worked example
Take . Since , the sigmoid value is
Using the compact derivative formula,
The same result follows from the exponential form:
If instead and , then the inner input is . The chain rule gives , so at this value of , .
What the derivative tells you
The derivative is always positive, so the logistic sigmoid is increasing. It reaches its largest slope at : there, , and therefore . As moves far in either direction, the sigmoid approaches 0 or 1 and its derivative approaches 0. This flattening at the ends is often called saturation.
Common mistakes
- Dropping the chain-rule factor: The derivative of includes a factor of ; the derivative of does not.
- Using the wrong sign: Differentiating gives . The negative from differentiating the reciprocal form cancels it, leaving a positive derivative.
- Confusing the derivative with the sigmoid itself: The derivative is , not just .
- Assuming every sigmoid has this formula: The identity applies to the logistic sigmoid. For example, if the function is defined as , its derivative is instead.
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.