Connect via MCP →

Enter Calculation

Formula

Show calculation steps (3)
  1. First Derivative

    First Derivative: Sigmoid Function Calculator (with First and Second Derivatives)

    Slope of the sigmoid; a = gain

  2. Second Derivative

    Second Derivative: Sigmoid Function Calculator (with First and Second Derivatives)

    Curvature of the sigmoid; a = gain

  3. Maximum Slope

    Maximum Slope: Sigmoid Function Calculator (with First and Second Derivatives)

    Peak slope of the sigmoid, attained at x = 0

Advertisement

Results

Sigmoid at x = 2 (a = 1)
0.880797
σ(x) = 1 / (1 + e^(-a·x))
σ'(x) first derivative
0.104994
σ''(x) second derivative
-0.079963
x σ(x) σ'(x) σ''(x)
-6 0.002473 0.002467 0.002454
-5.5 0.00407 0.004054 0.004021
-5 0.006693 0.006648 0.006559
-4.5 0.010987 0.010866 0.010627
-4 0.017986 0.017663 0.017027
-3.5 0.029312 0.028453 0.026785
-3 0.047426 0.045177 0.040892
-2.5 0.075858 0.070104 0.059468
-2 0.119203 0.104994 0.079963
-1.5 0.182426 0.149146 0.09473
-1 0.268941 0.196612 0.090858
-0.5 0.377541 0.235004 0.057557
0 0.5 0.25 0
0.5 0.622459 0.235004 -0.057557
1 0.731059 0.196612 -0.090858
1.5 0.817574 0.149146 -0.09473
2 0.880797 0.104994 -0.079963
2.5 0.924142 0.070104 -0.059468
3 0.952574 0.045177 -0.040892
3.5 0.970688 0.028453 -0.026785
4 0.982014 0.017663 -0.017027
4.5 0.989013 0.010866 -0.010627
5 0.993307 0.006648 -0.006559
5.5 0.99593 0.004054 -0.004021
6 0.997527 0.002467 -0.002454
Max slope σ'(0) = a/4 0.25

What is the sigmoid function?

The sigmoid, or logistic, function squashes any real number into the open interval (0, 1) with a smooth S-shaped curve. Defined as \(\sigma(x) = \frac{1}{1 + e^{-\text{a}\,x}}\), it is one of the most widely used activation functions in neural networks and a staple of logistic regression, probability modeling and growth curves. The gain parameter \(\text{a}\) controls how steep the transition is: with \(\text{a} = 1\) you get the classic textbook sigmoid, while larger \(\text{a}\) values compress the transition toward a step function.

S-shaped sigmoid curve crossing the y-axis at 0.5 with horizontal asymptotes at 0 and 1
The sigmoid function forms an S-shaped curve bounded between 0 and 1.

How to use this calculator

Enter the gain \(\text{a}\), then the range over which you want to evaluate the function: x minimum, x maximum and the x step (increment). The tool builds a table of \(\sigma(x)\), its first derivative \(\sigma^{\prime}(x)\) and second derivative \(\sigma^{\prime\prime}(x)\) at each step, and reports the single-point values at the optional x you supply. Make sure the step is greater than zero and that x maximum is at least x minimum, otherwise no rows are produced.

The formulas explained

The derivatives have especially clean forms when written in terms of \(\sigma\) itself. Differentiating gives $$\sigma^{\prime}(x) = \text{a}\,\sigma(x)\bigl(1 - \sigma(x)\bigr)$$ which is always positive (the curve is monotonically increasing) and reaches its maximum value of \(\frac{\text{a}}{4}\) at the inflection point \(x = 0\). The second derivative, $$\sigma^{\prime\prime}(x) = \text{a}^{2}\,\sigma(x)\bigl(1 - \sigma(x)\bigr)\bigl(1 - 2\,\sigma(x)\bigr)$$ changes sign at \(x = 0\) where \(\sigma = 0.5\), confirming the inflection point.

Advertisement
Sigmoid curve with its bell-shaped first derivative and S-shaped second derivative overlaid
The sigmoid (S-curve), its bell-shaped first derivative, and its second derivative.

Worked example

Take \(\text{a} = 1\) and \(x = 2\). Then \(e^{-2} = 0.135335\), so $$\sigma(2) = \frac{1}{1.135335} = 0.880797$$ The first derivative is $$0.880797 \times (1 - 0.880797) = 0.104994$$ The second derivative is $$0.104994 \times (1 - 2 \times 0.880797) = 0.104994 \times (-0.761594) = -0.079963$$ At \(x = 0\) the values are \(\sigma = 0.5\), \(\sigma^{\prime} = 0.25\) and \(\sigma^{\prime\prime} = 0\).

FAQ

What does the gain a do? It scales the input. A larger \(\text{a}\) makes the curve rise faster around \(x = 0\); as \(\text{a}\) grows the sigmoid approaches a hard step, while \(\text{a} = 0\) gives a flat line at 0.5.

Where is the steepest point? Always at \(x = 0\), where the slope equals \(\frac{\text{a}}{4}\) and the second derivative is zero.

Why is the output never exactly 0 or 1? The exponential never reaches zero for finite x, so \(\sigma\) stays strictly inside (0, 1). For extremely large \(|\text{a}\,x|\) the value rounds to 0 or 1 numerically, which this calculator handles safely.

Last updated: