Topic · Calculus

Derivatives

The derivative measures how a function changes — not on average over an interval, but right at a single point. It's the instantaneous rate of change, and equivalently the slope of the line that just barely kisses the curve. These two views are the same idea, and learning to see them as one is half the work of calculus.

What you'll leave with

  • The two intuitions for the derivative — instantaneous rate of change and slope of the tangent line — and why they're the same thing.
  • The limit definition $f'(x) = \lim_{h \to 0} \tfrac{f(x+h) - f(x)}{h}$, with each piece's meaning unpacked.
  • Fluency in the four common notations: $f'(x)$, $\tfrac{df}{dx}$, $\tfrac{d}{dx}[f]$, $\dot{f}$.
  • A worked derivation of $\tfrac{d}{dx}[x^2] = 2x$ from the definition.
  • The conditions under which a function fails to be differentiable — corners, cusps, vertical tangents, and the wild Weierstrass function.

1. The two intuitions

Ask two people what a derivative is and you'll often hear two different answers. Both are right.

Rate of change at an instant

You're driving and you glance at the speedometer. It says 60. But your trip took 90 minutes and covered 80 miles — that's an average speed of about 53. The 60 on the speedometer is something else: it's the rate you're moving right now, in this instant, with no interval to average over.

That's the first intuition. The derivative of a function $f$ at a point $x$ tells you how fast $f$'s output is changing, per unit change in input, at that single point. Position changes into velocity. Velocity changes into acceleration. Temperature changes into a heating rate. The derivative is the operation that takes a quantity and gives you its instantaneous rate.

Slope of the tangent line

Now picture the graph of $f$. Pick a point on the curve. Lay a straight ruler against it so the ruler touches the curve at that point and matches the curve's direction. That ruler is the tangent line, and its slope is the derivative.

If the curve is rising steeply at that point, the tangent has a large positive slope, and the derivative is a large positive number. If the curve is flat there (a peak, a valley, a momentary pause), the tangent is horizontal and the derivative is zero. If the curve is plunging downward, the derivative is negative.

One idea, two faces

These aren't two definitions to memorize separately. "Rate of change" and "slope" are the same number, computed the same way — the only difference is the picture you have in your head. A velocity is the slope of a position-vs-time graph. A slope is the rate at which $y$ changes per unit $x$. Pick whichever framing makes the problem in front of you easier to see.

2. The definition

Both intuitions sit on the same piece of algebra. Start with a function $f$, a point $x$ where you want to measure the rate, and a small step $h$ away from $x$.

Derivative of $f$ at $x$
$$ f'(x) \;=\; \lim_{h \to 0} \frac{f(x+h) - f(x)}{h} $$

The derivative exists at $x$ when this limit exists.

The fraction inside the limit looks intimidating until you read it piece by piece. Each part is doing exactly one job.

  • $f(x+h) - f(x)$ — the numerator. This is the change in the function's output as you step from $x$ to $x+h$. It's $\Delta y$, the "rise."
  • $h$ — the denominator. This is the change in input, $\Delta x$, the "run." Together with the numerator it forms $\tfrac{\Delta y}{\Delta x}$ — the average rate of change, or equivalently the slope of the line through the two points $(x, f(x))$ and $(x+h, f(x+h))$. This line is called a secant.
  • $\lim_{h \to 0}$ — the limit. This is the magic step. As you let $h$ shrink toward zero, the two points slide together. The secant line pivots and approaches the tangent. The average rate over a shrinking interval approaches the instantaneous rate at a point.

Put another way: the derivative is the limit of an average. You take an honest, finite-difference average rate of change, then you ask what happens to that average as the interval you're averaging over closes down to nothing.

Why a limit, not just $h = 0$

You can't simply set $h = 0$ — the denominator would be zero and the expression would be undefined. The whole purpose of the limit is to let $h$ get arbitrarily close to zero without ever reaching it, and to ask what number the fraction approaches. That's the difference between "evaluating" and "taking a limit," and it's the central technical move of differential calculus.

3. Notation

Mathematicians, physicists, and computer scientists have spent three centuries inventing ways to write the derivative. They all mean the same thing — pick whichever fits the situation. Knowing which is which keeps you from getting lost when you switch textbooks.

NotationRead asCommon in
$f'(x)$"$f$ prime of $x$"General use; Lagrange's notation, compact
$\dfrac{df}{dx}$"$d$-$f$ by $d$-$x$"Leibniz's notation; emphasizes "with respect to $x$"
$\dfrac{d}{dx}\!\left[f(x)\right]$"$d$ by $d$-$x$ of $f$"When you want to write the differentiation operator separately
$Df$ or $D_x f$"$D$ of $f$"Operator-heavy fields — differential equations, functional analysis
$\dot{f}$"$f$ dot"Physics, when the variable is time

Each style has a quiet bias. Lagrange's $f'$ is fastest to write. Leibniz's $\tfrac{df}{dx}$ keeps the input variable visible, which matters when you're juggling several. The operator form $\tfrac{d}{dx}[\cdot]$ is useful when you want to say "apply differentiation to this expression," for example $\tfrac{d}{dx}[x^2 + 3x] = 2x + 3$. The dot is shorthand: in physics, $\dot{x}$ almost always means $\tfrac{dx}{dt}$.

Note

Leibniz's $\tfrac{df}{dx}$ is not literally a fraction. It's a single symbol that behaves like a fraction in many situations (the chain rule, separable differential equations) — but the $df$ and $dx$ on their own only get meaning once you bring in differentials or differential forms. For now: it's one symbol, not two.

Higher-order derivatives

The derivative $f'$ is itself a function. You can differentiate it again to get the second derivative, $f''$, which measures the rate at which the rate is changing. Position differentiates into velocity; velocity differentiates into acceleration — that's $f \to f' \to f''$. Differentiate once more and you get the third derivative, $f'''$, and so on.

The notations parallel the first-derivative ones:

OrderLagrangeLeibnizNewton (dot)
First$f'(x)$$\dfrac{df}{dx}$$\dot{f}$
Second$f''(x)$$\dfrac{d^2 f}{dx^2}$$\ddot{f}$
Third$f'''(x)$$\dfrac{d^3 f}{dx^3}$
$n$th$f^{(n)}(x)$$\dfrac{d^n f}{dx^n}$

Past the third derivative the prime notation gets awkward, so people switch to $f^{(4)}$, $f^{(5)}$ — the parentheses distinguish "fourth derivative" from "fourth power." Geometrically, the second derivative tells you whether the curve is concave up (positive $f''$) or concave down (negative $f''$); we'll return to that when we get to curve sketching.

4. Computing from the definition

To make the definition concrete, let's take a function and crank it through. The function $f(x) = x^2$. The claim: $f'(x) = 2x$.

Step 1. Write down the difference quotient — the fraction inside the limit.

$$ \frac{f(x+h) - f(x)}{h} \;=\; \frac{(x+h)^2 - x^2}{h} $$

Step 2. Expand the numerator. This is just algebra: $(x+h)^2 = x^2 + 2xh + h^2$.

$$ \frac{(x^2 + 2xh + h^2) - x^2}{h} \;=\; \frac{2xh + h^2}{h} $$

The $x^2$ terms cancel. This is the moment the difference quotient earns its keep — the leftover bits all have $h$ as a factor.

Step 3. Factor $h$ out of the numerator and cancel with the $h$ in the denominator.

$$ \frac{h(2x + h)}{h} \;=\; 2x + h $$

This cancellation is the whole reason the limit will work. We've turned an expression that was $\tfrac{0}{0}$ at $h = 0$ into an ordinary expression that's defined there.

Step 4. Take the limit as $h \to 0$. Now there's nothing dangerous left — just plug in.

$$ f'(x) \;=\; \lim_{h \to 0} (2x + h) \;=\; 2x $$

Done. The derivative of $x^2$ is $2x$.

Read the result. At $x = 1$, the rate of change is $2$; at $x = 3$, it's $6$; at $x = 0$, it's $0$ — which makes sense because the parabola has a horizontal tangent at the origin. The two intuitions agree: the slope of the tangent and the instantaneous rate of change are both $2x$.

The pattern

The shape of this calculation — write the difference quotient, expand, watch the constant terms cancel, factor $h$, cancel, take the limit — repeats for every derivative you'll ever compute from the definition. Once you see it three or four times, you'll start to see why the rules of differentiation (power rule, product rule, chain rule) take the forms they do.

5. Geometric interpretation

Back to the picture. The derivative at a point is the slope of the tangent line at that point. The limit definition isn't just a formula — it is a recipe for constructing the tangent line, by taking secant lines and watching them swing into place.

In the figure below, the orange curve is $f(x) = \tfrac{1}{4}x^2$. The fixed point $P = (4, 4)$ is marked. Three secant lines connect $P$ to nearby points $Q_h = (4 + h, f(4+h))$ for shrinking values of $h$. The thick green line is the tangent at $P$ — the slope it approaches as $h \to 0$.

P = (4, 4) Q (h = 2) Q (h = 1) Q (h = 0.4) tangent at P slope = f'(4) = 2 f(x) = x² / 4 2 4 6 8 10 12 14 2 4 6 8 10 x y

Watch what happens: as $h$ shrinks from $2$ to $1$ to $0.4$, the secant line rotates and presses closer and closer to the tangent. The slope of the secant is $\tfrac{f(4+h) - f(4)}{h}$. Compute it for each:

$h$$Q$Secant slope $\tfrac{f(4+h) - 4}{h}$
$2$$(6, 9)$$\tfrac{9 - 4}{2} = 2.5$
$1$$(5, 6.25)$$\tfrac{6.25 - 4}{1} = 2.25$
$0.4$$(4.4, 4.84)$$\tfrac{4.84 - 4}{0.4} = 2.1$
$\to 0$$\to P$$\to 2$

The secant slopes march toward $2$. And indeed $f'(x) = \tfrac{x}{2}$ for $f(x) = \tfrac{x^2}{4}$, so $f'(4) = 2$. The tangent line at $P = (4, 4)$ is the line $y - 4 = 2(x - 4)$, or $y = 2x - 4$. The picture and the algebra say the same thing.

6. Differentiability

A function $f$ is differentiable at a point $a$ if the limit in the definition exists at $a$ — that is, if

$$ \lim_{h \to 0} \frac{f(a+h) - f(a)}{h} $$

is a single finite number, the same whether $h$ approaches $0$ from the left or from the right. When the limit doesn't exist — when the left- and right-hand limits disagree, or one of them runs off to infinity — the function fails to be differentiable at $a$, even if the function is perfectly well-defined there.

There are three classic ways a function can be continuous yet fail to be differentiable.

Corners

The absolute value function $f(x) = |x|$ is continuous everywhere — its graph is a single unbroken V. But at $x = 0$, the slope is $-1$ approaching from the left and $+1$ approaching from the right. The two one-sided limits disagree, so the two-sided limit doesn't exist. No tangent line; no derivative at zero.

Cusps

The function $f(x) = x^{2/3}$ has a graph that looks like a V with infinitely sharp walls meeting at the origin. As $h \to 0$, the difference quotient blows up: one side tends to $+\infty$, the other to $-\infty$. Same issue, more dramatic. No derivative at zero.

Vertical tangents

The function $f(x) = x^{1/3}$ is smooth and continuous through the origin, and there's even something that looks like a tangent line — but that tangent is vertical, with undefined (infinite) slope. The difference quotient diverges to $+\infty$ from both sides. No finite derivative.

Differentiable implies continuous — not the other way around

If $f$ is differentiable at $a$, then $f$ is continuous at $a$. This is a one-way street: the converse fails. The examples above are continuous at the trouble point but not differentiable there. The most extreme demonstration is the Weierstrass function, $W(x) = \sum_{n=0}^\infty a^n \cos(b^n \pi x)$ for suitable $a, b$ — continuous at every real number and differentiable at none. It was a shock when Weierstrass published it in 1872: it broke the assumption, common at the time, that "continuous" should mean "smooth almost everywhere."

So the takeaway: a derivative is a strong demand. The function has to be continuous, and the slope from the left has to match the slope from the right, and that common slope has to be finite. Most functions you'll meet in calculus pass this test on most of their domain — but the points where they fail it (corners, cusps, vertical tangents, jump discontinuities) are exactly the points worth flagging.

7. Playground: see the tangent line

Pick a function, slide $a$ along its domain, and watch the tangent line pivot. The point and the green line together tell you what the derivative is at every $a$ — a slope you can see, not just a number you compute.

f(x) =
1.00
x y
a = 1.00
f(a) = 1.00
f'(a) = 2.00 tangent: y = 2.00(x − 1.00) + 1.00
Copied!
Try this

Pick $f(x) = \sin(x)$ and slide $a$ from $0$ toward $\pi/2 \approx 1.57$. The tangent's slope shrinks from $1$ toward $0$ — exactly $\cos(a)$. Now slide past $\pi/2$: the slope goes negative, matching the curve's downturn. The picture is the formula $f'(x) = \cos(x)$, just animated.

8. Common pitfalls

Forgetting the limit step

The difference quotient $\tfrac{f(x+h) - f(x)}{h}$ is not the derivative — it's the slope of a secant. The derivative is what that slope approaches as $h \to 0$. Skipping the $\lim$ on a worked-out problem and writing $f'(x) = \tfrac{f(x+h) - f(x)}{h}$ is a wrong answer, even if you "know what you meant."

Treating a secant as a tangent

A secant and a tangent are different lines. A secant cuts the curve at two points; a tangent kisses it at one. The two coincide only in the limit. For any concrete $h > 0$, the secant slope is an approximation to the derivative — useful, but not the answer.

Reversing "differentiable implies continuous"

Differentiable at $a$ ⇒ continuous at $a$ is true. Continuous at $a$ ⇒ differentiable at $a$ is false. The implication is one-way. $f(x) = |x|$ at $x = 0$ is the classic counterexample: continuous but not differentiable.

$|x|$ "has slope $0$" at $0$ — no

It's tempting to think the absolute value function has a horizontal tangent at the origin because the graph "bottoms out" there. It doesn't. There's no tangent at all. The left slope is $-1$, the right slope is $+1$, and there's no single line that matches the curve in both directions.

9. Worked examples

Five derivatives, all from the limit definition. Try each before peeking — the muscle that matters is being able to push the algebra through to the cancellation.

Example 1 · Derivative of $f(x) = x^2$

Step 1. Difference quotient:

$$ \frac{(x+h)^2 - x^2}{h} $$

Step 2. Expand and simplify:

$$ \frac{x^2 + 2xh + h^2 - x^2}{h} \;=\; \frac{2xh + h^2}{h} \;=\; 2x + h $$

Step 3. Take the limit:

$$ f'(x) \;=\; \lim_{h \to 0} (2x + h) \;=\; 2x $$

Check. At $x = 3$, the tangent slope is $6$. The parabola is rising fast there — looks right.

Example 2 · Derivative of $f(x) = x^3$

Step 1. Difference quotient:

$$ \frac{(x+h)^3 - x^3}{h} $$

Step 2. Expand $(x+h)^3 = x^3 + 3x^2 h + 3x h^2 + h^3$:

$$ \frac{x^3 + 3x^2 h + 3x h^2 + h^3 - x^3}{h} \;=\; \frac{3x^2 h + 3x h^2 + h^3}{h} \;=\; 3x^2 + 3xh + h^2 $$

Step 3. Take the limit. The terms with $h$ vanish:

$$ f'(x) \;=\; \lim_{h \to 0}(3x^2 + 3xh + h^2) \;=\; 3x^2 $$

Check. The pattern $\tfrac{d}{dx}[x^n] = n x^{n-1}$ — the power rule — is starting to peek through.

Example 3 · Derivative of $f(x) = \tfrac{1}{x}$ (for $x \neq 0$)

Step 1. Difference quotient:

$$ \frac{\tfrac{1}{x+h} - \tfrac{1}{x}}{h} $$

Step 2. Combine the fractions in the numerator over a common denominator $x(x+h)$:

$$ \frac{\tfrac{x - (x+h)}{x(x+h)}}{h} \;=\; \frac{-h}{h \cdot x(x+h)} \;=\; \frac{-1}{x(x+h)} $$

Step 3. Take the limit. As $h \to 0$, $x + h \to x$:

$$ f'(x) \;=\; \lim_{h \to 0}\frac{-1}{x(x+h)} \;=\; -\frac{1}{x^2} $$

Check. The function is decreasing everywhere on its domain, so the derivative should be negative everywhere — and $-\tfrac{1}{x^2}$ indeed is.

Example 4 · Derivative of $f(x) = \sqrt{x}$ (for $x > 0$)

Step 1. Difference quotient:

$$ \frac{\sqrt{x+h} - \sqrt{x}}{h} $$

Step 2. Rationalize by multiplying by the conjugate $\tfrac{\sqrt{x+h} + \sqrt{x}}{\sqrt{x+h} + \sqrt{x}}$:

$$ \frac{(\sqrt{x+h} - \sqrt{x})(\sqrt{x+h} + \sqrt{x})}{h(\sqrt{x+h} + \sqrt{x})} \;=\; \frac{(x+h) - x}{h(\sqrt{x+h} + \sqrt{x})} \;=\; \frac{h}{h(\sqrt{x+h} + \sqrt{x})} $$

Cancel the $h$:

$$ \frac{1}{\sqrt{x+h} + \sqrt{x}} $$

Step 3. Take the limit. As $h \to 0$, $\sqrt{x+h} \to \sqrt{x}$, so the denominator approaches $2\sqrt{x}$:

$$ f'(x) \;=\; \frac{1}{2\sqrt{x}} $$

Check. At $x = 1$, slope $= \tfrac{1}{2}$; at $x = 4$, slope $= \tfrac{1}{4}$; at $x = 100$, slope $= \tfrac{1}{20}$. The square root flattens out for large $x$, which matches the derivative shrinking toward zero.

Example 5 · Equation of the tangent line to $f(x) = x^2$ at $x = 3$

Step 1. Find the slope. From Example 1, $f'(x) = 2x$, so $f'(3) = 6$.

Step 2. Find the point. $f(3) = 9$, so the tangent passes through $(3, 9)$.

Step 3. Plug into point-slope form for a line:

$$ y - 9 \;=\; 6(x - 3) $$ $$ y \;=\; 6x - 9 $$

Check. At $x = 3$, $y = 18 - 9 = 9$. ✓ The tangent passes through the point of tangency, as it must.

Sources & further reading

The treatment here is standard introductory differential calculus. The links below let you cross-check, drill, and dig deeper.

Test your understanding

A quiz that builds from easy to hard. Pick an answer to get instant feedback and a worked explanation. Your progress is saved in this browser — come back anytime to continue.

Question 1 of 24
0 correct