Lensa ML
Lensa ML

How Derivatives Work

Step 1 of 6

It Starts With Slope

How steep is the curve at one exact point?

-1123xy(1.5, 2.3)slope = 3.0f(x) = x²
Drag to move the pointx = 1.50
POINT
(1.5, 2.3)
SLOPE
3.00

The slope of the tangent line tells you how fast f(x) is changing at exactly that point. The derivative is just this: the instantaneous rate of change.

Step 1 of 6: It Starts With Slope

How steep is the curve at one exact point?

-1123xy(1.5, 2.3)slope = 3.0f(x) = x²
Drag to move the pointx = 1.50
POINT
(1.5, 2.3)
SLOPE
3.00

The slope of the tangent line tells you how fast f(x) is changing at exactly that point. The derivative is just this: the instantaneous rate of change.

Step 2 of 6: Two Points, One Line

Drag the second point closer — watch what happens to the slope

-0.50.51.52.53.5xyh = 1.50rise = 5.25a = 1a+hf(x) = x²
Drag the second point closer to a = 1h = 1.50
SECANT SLOPE
3.500
TRUE DERIVATIVE
2.000
ERROR
1.500

The secant line connects two points on the curve. Its slope = [f(a+h) - f(a)] / h. As you drag h smaller, the secant slope gets closer to the true derivative.

Step 3 of 6: Shrinking Toward Zero

The secant line becomes a tangent as h vanishes

-0.50.51.52.53.54.5xyx = 1.5h = 2.000 → slope = 5.000

The secant cuts through the curve at two points. As h shrinks, the second point slides toward the first.

Step 4 of 6: The Algebra Behind It

Step through the limit computation for f(x) = x²

Start with the definition
f'(x) = limh→0 f(x+h) - f(x)h

The derivative is defined as this limit as h approaches 0.

Step 5 of 6: The Derivative Function

Every x has its own slope — that gives us a whole new function

-2.5-1.5-0.50.51.52.5xyf(x) = x²y = 1.00-2.5-1.5-0.50.51.52.5xyf'(x) = 2xslope = 2.00
Slide x to explore both functionsx = 1.00
f(1.0)
1.00
f'(1.0) = slope
2.00

The curve is climbing here — f'(x) is positive. The steeper the curve, the higher the derivative.

Step 6 of 6: Why It Matters

Derivatives power everything from physics to machine learning

The Definition of the Derivative
f'(x) = limh→0 f(x+h) - f(x)h
🚀
Physics
Position → Velocity → Acceleration. Each is the derivative of the one before it.
📈
Economics
Marginal cost is the derivative of total cost. Tells you the cost of making one more unit.
🤖
Machine Learning
Gradient descent uses derivatives to find the minimum of a loss function — exactly how neural networks learn.
🏗️
Engineering
Rate of heat flow, stress analysis, signal processing — all built on derivatives.

The derivative is one of the most powerful ideas in mathematics. It turns the question "how fast is this changing?" into a precise, computable answer. Everything from rocket trajectories to training AI models depends on it.

Slope of tangent
Instantaneous rate
lim h→0
f'(x) = 2x