Interactive visualiser

Differentiation from first principles

Two points PP and QQ on a curve, a distance hh apart. As h→0h \to 0, the secant PQPQ turns into the tangent at PP, and its gradient f(x+h)−f(x)h\dfrac{f(x+h)-f(x)}{h} approaches f′(x)f'(x).

Loading the visualiser…

Works on a phone, tablet or computer — nothing to install, no account.

What you are looking at

The derivative is defined as a limit, f′(x)=lim⁡h→0f(x+h)−f(x)hf'(x) = \lim_{h \to 0} \dfrac{f(x+h)-f(x)}{h}. The quotient is the gradient of the secant through P=(x,f(x))P = (x, f(x)) and Q=(x+h,f(x+h))Q = (x+h, f(x+h)): the rise f(x+h)−f(x)f(x+h)-f(x) over the run hh, both marked on the graph. You can drag PP along the curve, drag QQ to either side of it, or press Shrink hh, which steps hh down through 0.5,0.2,0.1,…0.5, 0.2, 0.1, \dots to 0.0010.001 while the secant swings onto the dashed tangent.

The working panel follows a written answer. It substitutes numbers into the quotient, then simplifies algebraically before letting h→0h \to 0: for x2x^2, (x+h)2−x2h=2x+h→2x\dfrac{(x+h)^2 - x^2}{h} = 2x + h \to 2x; for x3−3xx^3 - 3x the quotient becomes 3x2+3xh+h2−33x^2 + 3xh + h^2 - 3; for sin⁡x\sin x it rests on sin⁡hh→1\dfrac{\sin h}{h} \to 1 and cos⁡h−1h→0\dfrac{\cos h - 1}{h} \to 0. Set h=0h = 0 and the secant disappears, because the quotient is undefined. Hide formulas turns the panel into a prediction question.

Try this

  1. 1With f(x)=x2f(x) = x^2 and PP at x=1x = 1, press Shrink hh: the gradient of PQPQ, which is 2+h2 + h, falls towards 2 as hh steps down to 0.0010.001.
  2. 2Drag QQ to the left of PP so that hh is negative: the gradient now approaches 2 from below. The limit is the same from both sides.
  3. 3Slide hh to exactly 0: the secant vanishes and the panel reports that the quotient is undefined, which is why the limit is taken only after simplifying.
  4. 4Choose sin⁡x\sin x and shrink hh: sin⁡hh\dfrac{\sin h}{h} approaches 1 and cos⁡h−1h\dfrac{\cos h - 1}{h} approaches 0, leaving f′(x)=cos⁡xf'(x) = \cos x.

Mistakes students make

  • Putting h=0h = 0 straight into f(x+h)−f(x)h\dfrac{f(x+h)-f(x)}{h}. That gives 00\dfrac{0}{0}; expand, cancel the factor hh first, and only then let h→0h \to 0.
  • Expanding (x+h)2(x+h)^2 as x2+h2x^2 + h^2. The correct expansion is x2+2xh+h2x^2 + 2xh + h^2, and the 2xh2xh term is the one that gives the derivative.
  • Dropping the limit too early, or ending with f′(x)=2x+hf'(x) = 2x + h. Keep writing lim⁡h→0\lim_{h \to 0} on every line until you actually let h→0h \to 0.

Where it is taught

  • IB Maths AA SL 5.1 · AA HL 5.12
  • AP Calculus AB/BC Unit 2
  • Edexcel A-Level Pure Year 1 · Differentiation from first principles
  • Edexcel A-Level Pure Year 2 · Differentiating sin x and cos x from first principles
  • Greek Lykeio year 3 (Γ΄ Λυκείου) · §2.1

Teaching this?

Put this visualiser on your lesson board with one tap. Your student sees every drag, live, on their own screen — and Owlileo marks the homework, runs the tests and keeps the parents informed.

Start free →