Derivative & Tangent Explorer

drag a point along a curve to see the slope

Loading interactive simulation...

A flat spot is not always a peak or a valley 🖖

A zero derivative means the tangent is horizontal — it does not promise a maximum or a minimum. Switch this tool to and drag the point to x = 0: the slope reads 0, yet the curve is climbing on both sides and simply pauses. That is an inflection point, and it is why finding where the derivative vanishes is only the first half of an optimisation problem. The second half is checking what the slope does on either side, because the derivative alone cannot tell a summit from a landing on a staircase.

Zoom in and the curve looks straight 🖖

Pick any smooth curve, zoom in close enough, and the bend disappears — locally it looks like a straight line. The derivative is simply the steepness of that line, and dragging the point here reads it off directly. A car's speedometer works the same way: it shows how fast your position is changing right now, not your average speed for the whole trip. Drag the point to the top of the parabola and the slope hits 0 — that flat spot marks a peak or a valley.

The curve with no tangent anywhere 🖖

Every function here has a clean tangent, but not every function does. In 1872 Karl Weierstrass built a function that is continuous everywhere yet has a defined slope nowhere — infinitely jagged at every scale, so no tangent line can ever settle. It stunned mathematicians who assumed a smooth-looking continuous curve must have tangents almost everywhere. The same nowhere-differentiable roughness later turned up in nature: the paths of Brownian motion and the outlines of coastlines behave exactly this way.

DERIVATIVES — WHICH RULE APPLIES, AND WHAT THE SLOPE ACTUALLY TELLS YOU

Which Derivative Case Are You Looking At?

The derivative is one idea — the slope of the tangent, the limit of (f(x+h) − f(x))/h — but the way you compute it depends on what kind of function you were handed, and the way you read the answer depends on whether it came out positive, negative or zero. Three standard rules cover most functions you will meet; the fourth case is the one where a zero slope does not mean what people assume.

Power rule — a polynomial term d/dx xn = n·xn−1
Trigonometric — sine and cosine trade places d/dx sin x = cos x
Exponential — the function is its own derivative d/dx ex = ex
Zero slope that is not a maximum or a minimum f′ = 0, f″ = 0

01

Power rule — a polynomial term

What you know: The function is xⁿ, or a sum of such terms. Bring the exponent down in front and knock one off it.

Rule: d/dx xn = n·xn−1

Worked example: f(x) = x² at x = 1 → f′(x) = 2x → f′(1) = 2, so the tangent is y = 2x − 1

Open this case: x² at x=1
Power rule — a polynomial term. The tangent at x = 1 has slope 2 and touches the parabola at a single point. The function is xⁿ, or a sum of such terms. Bring the exponent down in front and knock one off it.
The tangent at x = 1 has slope 2 and touches the parabola at a single point.

02

Trigonometric — sine and cosine trade places

What you know: The function is sin x or cos x. Differentiating rotates you through the cycle: sin → cos → −sin → −cos → sin.

Rule: d/dx sin x = cos x

Worked example: f(x) = sin x at x = 0 → f′(x) = cos x → f′(0) = 1, so the tangent is y = x

Open this case: sin at x=0
Trigonometric — sine and cosine trade places. At the origin sin x has slope 1, so the tangent is the line y = x. The function is sin x or cos x. Differentiating rotates you through the cycle: sin → cos → −sin → −cos → sin.
At the origin sin x has slope 1, so the tangent is the line y = x.

03

Exponential — the function is its own derivative

What you know: The function is eˣ. Differentiating changes nothing at all: f′(x) = f(x) at every point.

Rule: d/dx ex = ex

Worked example: f(x) = eˣ at x = 0 → f′(x) = eˣ → f′(0) = 1, so the tangent is y = x + 1

Open this case: e^x at x=0
Exponential — the function is its own derivative. Height and slope are the same number at every point on the curve. The function is eˣ. Differentiating changes nothing at all: f′(x) = f(x) at every point.
Height and slope are the same number at every point on the curve.

04

Zero slope that is not a maximum or a minimum

What you know: f′ = 0 at the point, so it is stationary — but the sign of f′ is the same on both sides, so it is not a turning point.

Rule: f′ = 0, f″ = 0

Worked example: f(x) = x³ at x = 0 → f′(x) = 3x² → f′(0) = 0, yet f′ > 0 on both sides: the curve flattens and carries on rising

Open this case: x³ inflection
Zero slope that is not a maximum or a minimum. The tangent is horizontal at the origin, but the curve keeps climbing on both sides. f′ = 0 at the point, so it is stationary — but the sign of f′ is the same on both sides, so it is not a turning point.
The tangent is horizontal at the origin, but the curve keeps climbing on both sides.
References (1)
  • Insight block 3 — continuous everywhere, differentiable nowhere: K. Weierstrass, "Über continuirliche Functionen eines reellen Arguments, die für keinen Werth des letzteren einen bestimmten Differentialquotienten besitzen." Read to the Berlin Academy, 18 July 1872; printed in Mathematische Werke, vol. 2, 71–74.

Problem solved in full

  1. The slope and tangent of f(x) = x² at x = 1 5 steps

    f(x) = x², at x = 1. Get the slope there from the definition rather than from a rule, write down the tangent, and then say exactly how far that tangent has drifted from the curve one tenth of a unit further along.

    1. A single point has no slope — slope is a comparison, so it needs two points. Take the second one a distance h away and measure the average rise over that run. The whole of differential calculus is this quotient plus one limit.

    2. Expand the square. The constant terms cancel, which leaves an h in every surviving term, so the h downstairs divides out cleanly. Notice what the cancellation costs you: it is legal for every h except 0, and 0 is precisely the value you are heading for.

    3. That is why the limit is taken rather than substituted. 2 + h is a straight line in h, so the value it approaches is read off without any approximation at all, and the slope at x = 1 comes out at 2 without the rule 2x ever being written down.

    4. A tangent needs a point and a slope, and you now have both: the curve passes through (1, 1) with slope 2.

    5. Subtract the line from the curve. The difference is not small, not approximately anything — it factorises exactly, so the parabola sits (x − 1)² above its tangent at every x, and at a distance h the gap is h².

    Answer

    f′(1) = 2, tangent y = 2x − 1, and the gap between them is exactly h²: shorten the step by a factor of 10 and the tangent's error drops by a factor of 100, from 0.01 to 0.0001. That squaring is the entire justification for replacing a curve by a line near a point. The sign of the gap, though, is worth more than its size. (x − 1)² is never negative, so this parabola touches its tangents and never crosses one. Put f(x) = x³ at x = 0 beside it: the tangent is the x-axis, the gap is x³ itself, and x³ is negative on the left and positive on the right, so the line passes clean through the curve. Both functions have a horizontal tangent somewhere and only one of them has a turning point there — a vanishing derivative is not what makes a minimum, the sign of the gap is.

Learning path

Why everything looks straight up close

Leads to riemann-sum local straightness as a number — the slope of the one line that agrees with the curve at a point.

Example problems

  • x² at x=1 - f(x)=x² at x=1 → slope f'(1)=2, tangent y=2x-1
  • sin at x=0 - f(x)=sin x at x=0 → slope f'(0)=1, tangent y=x
  • e^x at x=0 - f(x)=eˣ at x=0 → slope f'(0)=1; eˣ is its own derivative
  • x³ inflection - f(x)=x³ at x=0 → slope f'(0)=0, inflection point (not a min or max)