Ma · Mathematics

How to Find the Derivative of the Logistic Function

Updated 13 October 2026

At a glance

  1. 1. Write the function

    Use the standard sigmoid σ(x) = 1/(1 + e^(−x)).

  2. 2. Apply the chain rule

    Differentiate the reciprocal form, keeping track of the negative exponent.

  3. 3. Use the identity

    Rewrite the result as σ′(x) = σ(x)(1 − σ(x)).

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

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

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:

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

Now apply the chain rule. The outer function is the reciprocal power, and the inner function is 1+e−x1+e^{-x}:

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

To express this in terms of σ(x)\sigma(x), 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 by σ(x)\sigma(x) gives the standard identity:

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

Both expressions are equivalent. The exponential form is useful when you need a formula directly in terms of xx; the product form is convenient when the sigmoid value has already been calculated.

Worked example with a scaled input

Suppose a model uses

p(t)=σ(3t−2)=11+e−(3t−2).p(t)=\sigma(3t-2)=\frac{1}{1+e^{-(3t-2)}}.

The input to the sigmoid is 3t−23t-2, whose derivative is 33. The chain rule therefore gives

p′(t)=3σ(3t−2)(1−σ(3t−2)).p'(t)=3\sigma(3t-2)\bigl(1-\sigma(3t-2)\bigr).

At t=1t=1, the sigmoid’s input is 3(1)−2=13(1)-2=1, and σ(1)≈0.7311\sigma(1)\approx 0.7311. Thus

p′(1)=3(0.7311)(1−0.7311)≈0.5898.p'(1)=3(0.7311)(1-0.7311)\approx 0.5898.

The factor of 33 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

f(x)=A+B1+e−k(x−x0),f(x)=A+\frac{B}{1+e^{-k(x-x_0)}},

where AA sets one asymptotic level, BB sets the difference between the two asymptotic levels, kk controls the direction and steepness of the transition, and x0x_0 locates its midpoint. Differentiating gives

f′(x)=Bk σ(k(x−x0))[1−σ(k(x−x0))].f'(x)=Bk\,\sigma\bigl(k(x-x_0)\bigr)\left[1-\sigma\bigl(k(x-x_0)\bigr)\right].

Equivalently, in terms of f(x)f(x),

f′(x)=kB(f(x)−A)(A+B−f(x)),f'(x)=\frac{k}{B}\bigl(f(x)-A\bigr)\bigl(A+B-f(x)\bigr),

provided B≠0B\ne 0. If BB and kk are positive, the curve increases from AA toward A+BA+B. A negative kk 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, 0<σ(x)<10<\sigma(x)<1. The product u(1−u)u(1-u) reaches its maximum of 1/41/4 when u=1/2u=1/2, which occurs at x=0x=0. Therefore

0<σ′(x)≤14,0<\sigma'(x)\leq \frac14,

with the maximum slope 1/41/4 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 Bk/4Bk/4 when B,k>0B,k>0, at x=x0x=x_0.

Common mistakes

  • Dropping the chain-rule factor: For σ(kx+b)\sigma(kx+b), the derivative is kσ(kx+b)(1−σ(kx+b))k\sigma(kx+b)(1-\sigma(kx+b)), not just the product of sigmoid terms.
  • Confusing the function with its derivative: σ(x)(1−σ(x))\sigma(x)(1-\sigma(x)) is the derivative, not another expression for σ(x)\sigma(x).
  • Assuming every logistic curve has maximum slope 1/41/4: That value applies to the standard sigmoid. An output scale BB and input scale kk change the maximum slope to Bk/4Bk/4 when both are positive.
  • Ignoring the sign of the input scale: A negative kk 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.