Home
Login

Color

Indigo
Red
Green
Teal
Blue
Purple
Rose

Mode

Light
বাং

The derivative, seen as a secant that turns into a tangent

The derivative f′(x) is the slope of the tangent line to y = f(x) at a point. Take a second point Q a small distance h away, draw the secant through P and Q, and its slope is (f(x + h) − f(x)) / h. Shrink h towards 0 and that slope settles on a single number, the derivative, while the secant settles on the tangent.

Drag along the top graph to move P

Curve y = f(x)Secant through P and QTangent at PDerivative graph f′(x)
Speed

Controls

Function f(x)

1.00
2.00

Readings

Point P
(1, 1)
Point Q
(3, 9)
Line being drawn
Secant (h > 0)
Secant slope
4
Exact derivative f′(x)
2
Difference between them
2
Tangent line
y = 2x − 1

How to use this simulation

  1. Pick a function from “Function f(x)”: x², x³, sin x, eˣ or 1/x. The thick curve on top is y = f(x). The black dot P is the point we measure the steepness at. Drag along the top graph, or use “x of point P”, to move it.
  2. The orange dot Q sits a gap h away from P, and the orange line through both is the secant. At the start h = 2, so Q is far away and the secant is a rough average slope, nowhere near the curve’s real steepness at P.
  3. Press play. The gap h shrinks smoothly, Q slides along the curve towards P, and the secant swings round. When h reaches 0 the line turns green: it is the tangent, the line that just touches the curve at P.
  4. Watch the readings. “Secant slope” is (f(x + h) − f(x)) / h. “Exact derivative” is the true f′(x). As h shrinks, “Difference between them” falls towards zero. Pause and drag the h slider yourself to see it at any size.
  5. Look at the lower graph. It shows y = f′(x), the derivative function. The green dot marks f′ at P and the hollow orange ring marks the current secant slope. The ring slides into the dot as h goes to 0.
  6. Drag P to a new place and repeat. On x² the green dot climbs a straight line; on sin x it follows a cosine wave. The tangent equation in the readings updates for every position.

How steep is a curve?

A straight line has one slope everywhere: rise over run, the same number from start to finish. A curve is trickier. A ball thrown in the air climbs steeply, flattens at the top, then drops. Its steepness changes from one moment to the next. So what does “the slope at this exact point” even mean?

The trick is to zoom in. Zoom in far enough on any smooth curve and it looks like a straight line. The slope of that tiny straight stretch is the slope of the curve at that point, and the straight line itself is called the tangent. The derivative is the machine that gives you that number.

From a secant to a tangent

We cannot find a slope from one point alone, we need two. So we cheat. Take P on the curve and a second point Q a little way along. The line through both is called a secant, and its slope is easy: rise over run.

Now let Q slide towards P. The secant swings and the slope changes. Here is x² at x = 1, where P = (1, 1). The first column is the gap h, the second is the secant slope.

  • With h = 1 the secant slope is 3.0000. That is the average slope over a whole unit, so it is far from the truth.
  • With h = 0.1 it is 2.1000, and with h = 0.001 it is 2.0010.
  • The numbers are marching towards 2. That target is the derivative of x² at x = 1.
hSecant slope
13.0000
0.52.5000
0.12.1000
0.012.0100
0.0012.0010

The definition, written down

The slope of the secant through x and x + h is (f(x + h) − f(x)) / h. The derivative is what that settles on as h shrinks to zero. That “settles on” has a precise name, a limit.

We never actually put h = 0, because 0 ÷ 0 means nothing. We only ask what the ratio gets closer and closer to. In the simulation the last step jumps to h = 0 just to draw the finished tangent.

f′(x) = lim (h → 0) [f(x + h) − f(x)] / hthe first-principles definition

tangent: y = f′(a)·(x − a) + f(a)the tangent line at x = a

The derivative is a graph too

Move P and the tangent slope changes. Write down the slope for every x and you get a new function, f′(x). That is the lower graph in the simulation. Whenever the top curve rises, the lower graph sits above zero. Where the top curve has a peak or a trough, the lower graph crosses zero. Where the top curve falls, the lower graph is negative.

For x² the table shows the pattern: the height and the slope at five points. The slope is exactly twice x.

xx²Slope of x²
-24-4
-11-2
000
112
244

The five functions in the simulation

Each of these has a known derivative. The table lists it, and the last column is the slope at x = 1, so you can check it against the simulation by setting “x of point P” to 1.

  • x² has a slope that grows steadily: 2x. It is flat at 0, rising on the right, falling on the left.
  • x³ has slope 3x², which is never negative. The curve never goes downhill, but it flattens for a moment at 0.
  • sin x has slope cos x. The derivative graph is the same wave shifted a quarter turn.
  • eˣ is the one function whose slope equals its height, everywhere. The two graphs are identical.
  • 1/x has slope −1/x², always negative. The curve falls on both sides of the break at 0.
f(x)f′(x)Slope at x = 1
x²2x2
x³3x²3
sin xcos x0.5403
eˣeˣ2.7183
1/x−1/x²-1

Try it in the simulation

Six quick experiments, a minute each.

  • Choose x². Press play and watch h shrink. Note the secant slope at the end and compare it with 2x at the P you chose.
  • Pause, drag P to x = 0 on x². The tangent is flat. What does the lower graph read there?
  • Choose eˣ and look at the two graphs. Can you tell which is which without the labels?
  • Choose sin x. Drag P to the top of the wave. The tangent goes flat. Now drag to where the curve crosses the axis. Is the tangent steepest here?
  • Choose 1/x. Drag P close to 0 on the right, then on the left. Why does the slope blow up?
  • Choose x³, set h to 2, and drag P around. The secant overshoots at large h. At what size of h does it start to look like the tangent?

Solved problems

Eight common questions. Every number below is computed with the same functions as the simulation.

Problem 1: slope of x² at x = 1

P = (1, 1). Slopes of the secant for shrinking h were in the table above, heading for 2. By the first-principles rule, (1 + h)² − 1 = 2h + h², divide by h to get 2 + h, which becomes 2 when h goes to 0. The tangent line is y = 2x − 1.

Problem 2: tangent to x³ at x = 2

P = (2, 8). The slope is 3x² = 3 × 4 = 12. Check against the secant table: the slopes close in on 12 from above. The tangent line is y = 12x − 16.

hSecant slope
119.0000
0.515.2500
0.112.6100
0.0112.0601
0.00112.0060

Problem 3: slope of sin x at 0 and at π/2

At x = 0 the secant slope is sin h ÷ h. For h = 1, 0.5, 0.1, 0.01, 0.001 the values are below, climbing to 1. So the tangent at the origin is y = x: for tiny angles, sin x is almost x.

At x = π/2 (the top of the wave) the height is 1 and the slope is cos(π/2) = 0, a flat tangent: y = 1.

hSecant slope
10.8415
0.50.9589
0.10.9983
0.011.0000
0.0011.0000

Problem 4: slope of eˣ at 0 and at 1

At x = 0 the slopes of the secant close in on 1, and the tangent there is y = x + 1. At x = 1 the height is e ≈ 2.7183, and the slope is the same number, so the tangent is y = 2.7183x: it passes straight through the origin, which is a lovely fact about eˣ.

hSecant slope at 0
11.7183
0.51.2974
0.11.0517
0.011.0050
0.0011.0005

Problem 5: tangent to 1/x at x = 2

P = (2, 0.5). The slope is −1/x² = −1/4 = -0.25. The tangent line is y = −0.25x + 1. The secant slopes below close in on -0.25; they start further away because the curve bends sharply near 0.

hSecant slope
1-0.1667
0.5-0.2000
0.1-0.2381
0.01-0.2488
0.001-0.2499

Problem 6: where is the tangent to x² parallel to y = 4x + 1?

Parallel lines have equal slopes, so we need 2x = 4 and x = 2. The point is (2, 4) and the tangent there is y = 4x − 4. Notice the slope matches, but the intercept is different, so the lines never meet.

Problem 7: first principles for x² at x = 3

(3 + h)² − 3² = 6h + h². Divide by h and you get 6 + h. The table shows the numerator and the slope for three gaps; the slope heads for 6.

h(3 + h)² − 9Secant slope
177.00
0.10.616.10
0.010.06016.01

Problem 8: where does x³ have slope 12?

3x² = 12 gives x² = 4, so x = 2 or x = −2. The tangents are y = 12x − 16 at (2, 8) and y = 12x + 16 at (−2, -8). Two points, one slope, because 3x² cannot tell positive from negative x.

Real life version: a car’s position is s = t² metres after t seconds. The speed at t = 3 is the slope, 6 m/s, and at t = 5 it is 10 m/s.

Common mistakes

Four slips that cost marks every year.

  • Putting h = 0 straight into the fraction. You get 0 ÷ 0. Expand and simplify first, then let h shrink.
  • Confusing the secant with the tangent. The secant joins two points on the curve. The tangent touches at one point.
  • Reading the derivative as the height. f′(a) is the slope at a, not the value f(a).
  • Forgetting the point when writing the tangent: use y = f′(a)(x − a) + f(a), not just y = f′(a)x.

Where derivatives are used

Speed is the derivative of position. Acceleration is the derivative of speed. The rate at which a population grows, a tank empties, or a drug leaves the bloodstream is a derivative. Economists use it for marginal cost, engineers for how fast a signal rises, and machine learning trains by following slopes downhill.

Exam corner

Typical SSC higher-math, HSC and first-year questions on this topic.

  • Find f′(x) by the definition (first principles), for x², x³ or 1/x.
  • Write the equation of the tangent at a given point.
  • Find the point where the tangent is parallel to a given line, or horizontal.
  • Read from a graph where the derivative is positive, zero or negative.

Revision summary

Slope of a curve = slope of its tangent. Secant slope = (f(x + h) − f(x)) / h. Let h go to 0 and the secant becomes the tangent. The limit is the derivative f′(x). Tangent line: y = f′(a)(x − a) + f(a).

Frequently asked questions

What is the derivative in simple words?

It is how steep a curve is at one exact point: the slope of the tangent line there. It also tells you how fast y changes compared with x at that instant.

What is the difference between a secant and a tangent?

A secant cuts the curve at two points. A tangent just touches it at one point and has the same direction as the curve there. A tangent is the limit of secants as the second point approaches the first.

Why can’t we simply put h = 0?

Because (f(x + h) − f(x)) / h becomes 0 ÷ 0, which is undefined. We simplify first, so h cancels, and then see what value the ratio approaches.

How do I write the equation of a tangent?

Find f(a) and f′(a), then use y = f′(a)(x − a) + f(a). Tidy it into y = mx + c if needed.

What does a zero derivative mean?

The tangent is horizontal at that point. On a smooth curve this usually marks a peak, a trough or a momentary flat spot, like x³ at 0.

Why does the slope of 1/x get huge near 0?

The curve shoots up (or down) almost vertically as x approaches 0, so tiny steps in x give enormous steps in y. The slope −1/x² grows without limit.

Does a derivative always exist?

No. At a sharp corner, like the tip of |x|, or a break, the secant slopes from the left and right disagree, so there is no single tangent. Every function in this simulation is smooth wherever it is defined.

Keep studying this topic

The animation made the idea click; now turn it into marks. Syllabus, suggestions, textbooks and admission-test guides are below.

More math animations

Grade 8–10

Pythagorean Theorem

The Pythagorean theorem explained: formula a² + b² = c², two proofs you can watch, the converse, Pythagorean triples and 10 worked examples. Drag the triangle yourself.

Grade 10–11

Trigonometric Ratios and the Unit Circle

Drag a point round the unit circle and watch sin, cos and tan change. Standard angle table, ASTC signs, identities, radians and graphs, with solved examples.

Grade 9–11

Quadratic functions and their graphs

Drag the vertex and change a, b, c to see how a quadratic function graph moves. Learn factoring, completing the square, the quadratic formula and discriminant.

Grade 9–10

Circle theorems

All the circle theorems with drag-and-check diagrams: angle at the centre, same segment, semicircle, cyclic quadrilateral, chords, tangents and alternate segment.

Grade 9–10

Heights and distances: elevation and depression angles

What angle of elevation and angle of depression mean, how the height-and-distance formula works, and how two observations solve a tower's height without ever measuring it — with an interactive simulation and solved problems.

Grade 9–11

Probability: experimental vs theoretical probability

What probability means, how the sample-space formula P(E) = n(E)/n(S) works, and why experimental frequency edges closer to theoretical probability the more you flip, roll or draw — with a coin, dice and coloured-ball simulator.

Grade 10–11

Arithmetic and Geometric Sequences

Learn the arithmetic and geometric sequence formulas for the nth term and sum, Gauss's pairing trick, and the sum-to-infinity formula a/(1−r), with a drag-and-slide bar-chart simulation and worked examples.

Grade 9–10

Mean, Median and Mode

Learn the mean, median and mode formulas, why the median resists an outlier while the mean does not, and the grouped-data median/mode formulas, by dragging points on a number line, with worked examples.

Grade 7–11

Sets and Venn Diagrams

Shade union, intersection, difference and complement on a live Venn diagram, drop numbers into regions, check n(A ∪ B) and test De Morgan’s laws, with solved problems.

Grade 8–10

Linear equations: graphs, slope and simultaneous pairs

See slope, intercepts and angle on a straight line, then graph two linear equations to find where they meet. Learn the ratio test for one, none or infinite solutions.

Grade 10–12

Graphs of sin, cos and tan

Plot y = A sin(Bx + C) + D with sliders: see amplitude, period, phase shift, range and the asymptotes of tan live. Trigonometric graphs with solved examples.

Grade 9–10

Completing the Square and the Quadratic Formula

Watch algebra tiles complete the square, then solve quadratic equations, find the vertex and see why the formula works. Free interactive simulation with solved examples.

Grade 7–10

Area of a Circle: Proof, Formula and Solved Problems

Cut a circle into slices, slide them into a rectangle and watch the area become πr². Free interactive simulation with circumference, pi, sectors, arcs and solved problems.

Grade 8–10

Volume and Surface Area of Solids: Cube, Cuboid, Cylinder, Cone, Sphere

Rotate six solids in 3D, unfold their nets and pour a cone into a cylinder to see why it takes exactly three. Free simulation with volume, CSA and TSA formulas and solved problems.

Grade 8–10

Similar Triangles: Scale Factor, AA, SSS, SAS and Shadow Heights

Scale a triangle with a slider and watch angles stay equal, side ratios stay k and area grow by k². Free interactive similar triangles simulation with AA, SSS, SAS tests and shadow problems.

Grade 9–11

Coordinate Geometry: Distance, Midpoint, Slope, Section Formula and Locus

Drag points on a grid and watch the distance formula, midpoint, slope and section formula update live. Free coordinate geometry simulation with the perpendicular-bisector locus and solved problems.

Grade 11–12

Conic Sections: Circle, Ellipse, Parabola and Hyperbola

Tilt a plane through a double cone and watch a circle, ellipse, parabola or hyperbola appear, with its standard equation, foci and eccentricity. Free conic sections simulation with solved problems.

Grade 9–11

Function Transformations: Shifts, Stretches and Reflections

Pick x², |x|, √x, sin x or 2^x and drag sliders for a, b, h and k. Watch shifts, stretches, squeezes and reflections move the graph, with the parent faded behind. Free simulation with solved problems.

Grade 11–12

Riemann Sums and Integration: Area Under a Curve

Cut the area under x², x³, sin x, eˣ or √x into up to 100 strips and compare left, right, midpoint and trapezoid sums with the exact integral. Watch the error melt away. Free simulation.

Grade 11–12

Limits and the ε–δ Definition: A Visual Guide

See the epsilon-delta definition of a limit. Pick a function, shrink ε and watch the δ band follow it, with left and right limits, a hole, sin x / x and a jump where no δ works. Free simulation.

Grade 11–12

3D Vectors: Sum, Dot Product and Cross Product

Drag to rotate two 3D vectors. See the sum as a parallelogram, the dot product as a shadow and an angle, and the cross product as a perpendicular arrow whose length is the area. Free simulation.

Grade 11–12

Matrix Transformations: Rotation, Reflection, Shear and the Determinant

Change a 2×2 matrix and watch the grid, a unit square and an F-shape move. See where i-hat and j-hat land, the determinant as signed area, and the inverse. Free simulation.

Grade 11–12

Complex Numbers: Sum, Product, Powers and Roots on the Argand Plane

Drag two complex numbers on the Argand plane. See the sum as a parallelogram, the product as a rotation and stretch, conjugates, powers as a spiral and roots of unity. Free simulation.

Grade 9–12

Binary Number System: Place Value, Conversion and Addition

Flip bits and see decimal, binary, octal and hex change together. Watch conversion by repeated division by 2, regrouping into octal and hex, and binary addition with carries. Free, with worked examples.

Animations in other subjects

Physics

Refraction of light

Physics

Ohm's law

Physics

Projectile motion

Physics

Simple pendulum

Physics

Electric field

Physics

Wave interference

Physics

Free Fall

Physics

Lens ray diagrams

Physics

Newton's Laws of Motion

Physics

Spherical mirror ray diagrams

Physics

Electromagnetic Induction

Physics

Conservation of Momentum and Collisions

Physics

Work, Energy and Power

Physics

Inclined Plane

Physics

Uniform circular motion

Physics

Transverse and Longitudinal Waves

Physics

Levers and moments

Physics

Centre of mass

Physics

Spring-mass SHM

Physics

Vector addition: triangle and parallelogram laws

Physics

Relative velocity: trains and river crossing

Physics

Kepler's laws and elliptical orbits

Physics

Newton’s law of gravitation, g and satellites

Physics

Standing waves in strings and pipes

Physics

Resonance tube and the speed of sound

Physics

Beats: when two close notes pulse

Physics

Doppler effect: moving sources, listeners and sonic booms

Physics

Prism, dispersion of light and the rainbow

Physics

Kirchhoff’s laws: junction rule and loop rule

Physics

Wheatstone bridge and metre bridge

Physics

Single-slit diffraction

Physics

Defects of the human eye and their correction

Physics

Polarisation of light: Malus’s law and Brewster’s law

Physics

Charging and discharging a capacitor: the RC time constant

Physics

Magnetic field lines: bar magnet, current-carrying wire and solenoid

Physics

AC generator

Physics

Transformer

Physics

Heat transfer: conduction, convection and radiation

Physics

Photoelectric effect: Einstein’s equation and the stopping potential

Physics

Motor effect: force on a current-carrying wire and the DC motor

Physics

Gas molecules and kinetic theory: pressure, temperature and speed

Physics

The semiconductor diode: p–n junction, I–V curve and rectifier

Physics

Radioactive decay: half-life, the decay law and penetration

Physics

The Bohr atom: orbits, energy levels and the hydrogen spectrum

Chemistry

Structure of the atom

Chemistry

Acids, Bases and the pH Scale

Chemistry

Electron configuration

Chemistry

Gas laws: Boyle, Charles, Gay-Lussac, Avogadro and PV = nRT

Chemistry

How an Ionic Bond Forms

Chemistry

Electrolysis and Faraday’s Laws

Chemistry

Covalent Bond

Chemistry

Periodic Trends

Chemistry

Reaction rate and collision theory

Chemistry

States of matter: solid, liquid, gas and the heating curve

Chemistry

Atomic orbitals: the shapes of s, p and d, quantum numbers and nodes

Chemistry

Molecular shapes and VSEPR theory: bond pairs, lone pairs and angles

Chemistry

The mole concept: molar mass, Avogadro’s number and molar volume

Chemistry

Diffusion and effusion: Graham’s law of gases

Chemistry

Balancing chemical equations: method, examples and practice

Chemistry

Chemical equilibrium: the equilibrium constant Kc and Le Chatelier’s principle

Chemistry

Titration: finding an unknown concentration with a burette and an indicator

Chemistry

Galvanic cell: the Daniell cell, EMF and the Nernst equation

Chemistry

Redox reactions: oxidation numbers, electron transfer and half-equations

Chemistry

Hydrocarbons: alkanes, alkenes, alkynes and structural isomers in 3D

Chemistry

Functional groups: alcohols, aldehydes, ketones, acids, esters and amines

Chemistry

Polymerisation: addition and condensation polymers, polythene and nylon

Chemistry

Separation techniques: filtration, distillation, chromatography, crystallisation

Chemistry

Crystal lattice: SC, BCC and FCC unit cells, packing efficiency and density

Chemistry

Radioactivity: Alpha, Beta, Gamma Decay and Half-Life

Biology

Mitosis cell division

Biology

Diffusion and Osmosis

Biology

Photosynthesis

Biology

The human heart: structure and function

Biology

Mendelian Genetics

Biology

DNA Replication

Biology

Cellular Respiration

Biology

Enzyme Action

Biology

The Nerve Impulse and the Action Potential

Biology

The Nephron and Urine Formation

Biology

Meiosis Cell Division

Biology

Digestive System

Biology

Breathing Mechanism: Inhalation and Exhalation

Biology

Protein synthesis

Biology

Blood circulation: double circulation and cardiac output

Biology

Cell structure and organelles: plant cell vs animal cell

Biology

Reflex action and the reflex arc

Biology

The human eye: parts, image formation and accommodation

Biology

Muscle contraction and the sliding-filament model

Biology

Transport in plants: xylem, phloem and transpiration

Biology

Food chain and food web: energy flow and the 10 % rule

Biology

Population growth: exponential and logistic curves

Biology

Natural selection: peppered moths and the sooty tree

Biology

Immune response: primary and secondary antibody response

Biology

Pollination and fertilisation