Ma · Mathematics

What Is the Derivative of the Sigmoid Function?

Updated 13 October 2026

At a glance

  1. 1. Identify the sigmoid

    Use the logistic sigmoid, defined as one divided by one plus e to the negative x.

  2. 2. Differentiate

    Apply the chain rule to obtain the exponential form of the derivative.

  3. 3. Rewrite the result

    Express the derivative compactly as the sigmoid value times one minus that value.

  4. 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

σ(x)=11+e−x.\sigma(x)=\frac{1}{1+e^{-x}}.

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:

σ′(x)=ddx(1+e−x)−1=−(1+e−x)−2(−e−x)=e−x(1+e−x)2.\begin{aligned} \sigma'(x) &=\frac{d}{dx}(1+e^{-x})^{-1}\\ &=-(1+e^{-x})^{-2}(-e^{-x})\\ &=\frac{e^{-x}}{(1+e^{-x})^2}. \end{aligned}

This is already a correct derivative. To express it in terms of the sigmoid itself, note that

1−σ(x)=1−11+e−x=e−x1+e−x.1-\sigma(x)=1-\frac{1}{1+e^{-x}}=\frac{e^{-x}}{1+e^{-x}}.

Multiplying this by σ(x)\sigma(x) gives the derivative:

σ′(x)=σ(x)(1−σ(x)).\boxed{\sigma'(x)=\sigma(x)\bigl(1-\sigma(x)\bigr)}.

The two derivative forms are equivalent. Use the exponential form when you want a formula directly in terms of xx, or the compact form when you already know the sigmoid’s output.

Applying the chain rule

If the sigmoid takes an inner function g(x)g(x) as its input, differentiate both the outer sigmoid and the inner function:

ddxσ(g(x))=σ(g(x))(1−σ(g(x)))g′(x).\frac{d}{dx}\sigma(g(x))=\sigma(g(x))\bigl(1-\sigma(g(x))\bigr)g'(x).

For example, if f(x)=σ(3x+2)f(x)=\sigma(3x+2), then the inner function has derivative 33, so

f′(x)=3σ(3x+2)(1−σ(3x+2)).f'(x)=3\sigma(3x+2)\bigl(1-\sigma(3x+2)\bigr).

More generally, for f(x)=σ(ax+b)f(x)=\sigma(ax+b), the derivative is aσ(ax+b)(1−σ(ax+b))a\sigma(ax+b)(1-\sigma(ax+b)). The factor aa is essential: it comes from differentiating the input, not from the sigmoid itself.

For a neural-network unit with z=wTx+bz=\mathbf{w}^{\mathsf T}\mathbf{x}+b and output y=σ(z)y=\sigma(z), the derivative with respect to zz is y(1−y)y(1-y). By the chain rule, the gradient with respect to the input vector is y(1−y)wy(1-y)\mathbf{w}.

Worked example

Take x=ln⁡3x=\ln 3. Since e−ln⁡3=1/3e^{-\ln 3}=1/3, the sigmoid value is

σ(ln⁡3)=11+1/3=34.\sigma(\ln 3)=\frac{1}{1+1/3}=\frac{3}{4}.

Using the compact derivative formula,

σ′(ln⁡3)=34(1−34)=316.\sigma'(\ln 3)=\frac{3}{4}\left(1-\frac{3}{4}\right)=\frac{3}{16}.

The same result follows from the exponential form:

e−ln⁡3(1+e−ln⁡3)2=1/3(4/3)2=316.\frac{e^{-\ln 3}}{(1+e^{-\ln 3})^2} =\frac{1/3}{(4/3)^2} =\frac{3}{16}.

If instead h(t)=σ(2t)h(t)=\sigma(2t) and t=(ln⁡3)/2t=(\ln 3)/2, then the inner input is 2t=ln⁡32t=\ln 3. The chain rule gives h′(t)=2σ(2t)(1−σ(2t))h'(t)=2\sigma(2t)(1-\sigma(2t)), so at this value of tt, h′(t)=3/8h'(t)=3/8.

What the derivative tells you

The derivative is always positive, so the logistic sigmoid is increasing. It reaches its largest slope at x=0x=0: there, σ(0)=1/2\sigma(0)=1/2, and therefore σ′(0)=1/4\sigma'(0)=1/4. As xx 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 σ(3x+2)\sigma(3x+2) includes a factor of 33; the derivative of σ(x)\sigma(x) does not.
  • Using the wrong sign: Differentiating e−xe^{-x} gives −e−x-e^{-x}. The negative from differentiating the reciprocal form cancels it, leaving a positive derivative.
  • Confusing the derivative with the sigmoid itself: The derivative is σ(x)(1−σ(x))\sigma(x)(1-\sigma(x)), not just 1−σ(x)1-\sigma(x).
  • Assuming every sigmoid has this formula: The identity applies to the logistic sigmoid. For example, if the function is defined as tanh⁡(x)\tanh(x), its derivative is 1−tanh⁡2(x)1-\tanh^2(x) instead.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.