Home
Login

Color

Indigo
Red
Green
Teal
Blue
Purple
Rose

Mode

Light
বাং

Function transformations: one graph, four knobs, and the rule behind them

A transformation moves, stretches or flips the graph of a parent function. In y = a·f(b(x − h)) + k, k slides the graph up, h slides it right, a stretches it vertically (and flips it when negative), and b squeezes it horizontally by a factor of 1/b (and flips it when negative). Every point (x, y) of the parent lands on (x ÷ b + h, a·y + k).

Parent graph y = f(x)Transformed graphPoint P and its image P′
Speed

Controls

Parent function f(x)

2.0
1.0
1.0
-1.0

Readings

Equation
y = 2(x − 1)² − 1
Where every point goes
(x, y) → (x + 1, 2y − 1)
Effect of a
Stretched vertically ×2
Effect of b
No horizontal change
Effect of h
Moved right by 1
Effect of k
Moved down by 1
Vertex
(1, -1)
Axis of symmetry
x = 1

How to use this simulation

  1. Pick a parent function with “Parent function f(x)”: x², |x|, √x, sin x or 2ˣ. The faded grey curve is the parent y = f(x); the bold coloured curve is the transformed graph. The sliders start at y = 2(x − 1)² − 1: a = 2, h = 1, k = -1.
  2. Move k first. The whole graph slides up or down, nothing else changes. Then move h: it slides sideways, and the sign is the surprise, because h = 1 moves the graph to the right, not to the left.
  3. Move a. Large positive values stretch the graph away from the x-axis, values between 0 and 1 squash it towards the x-axis, and negative values flip it over the x-axis. Set a = 0 and the graph collapses onto the line y = k.
  4. Move b. It acts on the x direction and does the opposite of what you might guess: b = 2 squeezes the graph to half its width, b = 0.5 stretches it to double the width, and a negative b flips it over the y-axis. Try it on sin x to see the wave get faster.
  5. Watch the grey dot P walk along the parent graph while the orange dot P′, its image, walks along the new one, joined by a dashed line. That dashed line is the rule (x, y) → (x ÷ b + h, a·y + k) in action.
  6. Read the “Effect” boxes. Each slider has its effect written out in words, and the last two readings follow the vertex, midline or asymptote and the domain, period or range as you move.

One graph, four knobs

Think of the graph of x² as a rubber band shaped like a U. You can slide the whole band up, down, left or right. You can pull it taller or squash it flatter. You can flip it upside down. You can squeeze it narrower. All of that is still the same shape of band, just handled differently. That is exactly what function transformations are.

The beautiful part is that you do not need a new graph for every new equation. If you know the five or six basic graphs and the four knobs, you can sketch y = −2√(x + 3) + 1 or y = 3 sin(2x) − 1 in under a minute. This simulation lets you turn the knobs and see each effect separately.

The five parent functions

Each parent function is the simplest member of a family. The table gives three readings of each at x = −2, 0 and 2. A dash means the function is not defined there: √x only exists for x ≥ 0.

  • x²: U-shaped, vertex at the origin, never below zero.
  • |x|: V-shaped, vertex at the origin, never below zero.
  • √x: half of a sideways U, starting at the origin, nothing for negative x.
  • sin x: a smooth wave between −1 and 1 that repeats every 2π (about 6.28).
  • 2ˣ: always positive, doubles for every step to the right, flattens towards the x-axis on the left.
f(x)f(−2)f(0)f(2)
x²404
|x|202
√x—01.41
sin x-0.9100.91
2ˣ0.2514

k: moving up and down

Adding k to the output lifts every point by k. For y = x² + 3 the vertex rises from (0, 0) to (0, 3), and every y-value is 3 bigger than the parent’s. This one behaves exactly as it looks: plus means up, minus means down.

y = f(x) + kk > 0 moves the graph up, k < 0 moves it down

xx²x² + 3
-247
-114
003
114
247

h: moving left and right (the sign trap)

Subtracting h from the input shifts the graph to the right by h. The graph of (x − 2)² has its vertex at x = 2: the output is zero when the input is 2. So x − 2 moves right, even though it has a minus sign. And x + 3 = x − (−3) moves left.

The cleanest way to remember it: find the input that makes the bracket zero. For (x − 2) it is x = 2, and for (x + 3) it is x = −3. That input is where the parent’s special point (the vertex, the start, the middle) lands.

y = f(x − h)h > 0 moves the graph right, h < 0 moves it left

a: stretching and flipping

Multiplying the output by a multiplies every height by a. If |a| > 1 the graph is stretched away from the x-axis. If 0 < |a| < 1 it is squashed towards it. If a is negative every height changes sign, so the graph flips over the x-axis. The points that sit on the x-axis (where y = 0) do not move at all.

y = a · f(x)|a| > 1 stretches, |a| < 1 squashes, a < 0 also reflects in the x-axis

x|x|−3|x|
-22-6
-11-3
000
11-3
22-6

b: squeezing and flipping sideways

Multiplying the input by b makes the function run b times faster, so the graph is compressed horizontally to 1/b of its width. With b = 2 the graph is half as wide. With b = 0.5 it is twice as wide. A negative b also reflects the graph over the y-axis.

The cleanest example is sine. sin x repeats every 6.28 (that is 2π). sin(2x) repeats every 3.14, twice as often. sin(x/2) repeats every 12.57, half as often. In general the period is 2π ÷ |b|.

y = f(b·x)|b| > 1 squeezes by 1/|b|, |b| < 1 stretches by 1/|b|, b < 0 also reflects in the y-axis

period of sin(bx) = 2π / |b|

Putting it together: the point rule

All four knobs together give y = a·f(b(x − h)) + k. Read it from the inside out: subtract h, multiply by b, apply f, multiply by a, add k. A point (x, y) on the parent graph then lands on (x ÷ b + h, a·y + k): the x-coordinate undoes b and shifts by h, the y-coordinate is multiplied by a and shifted by k.

At the start the simulation shows y = 2(x − 1)² − 1, with a = 2, b = 1, h = 1 and k = -1. The vertex moves from (0, 0) to (1, -1). Here is where five points of x² go.

(x, y) → (x/b + h, a·y + k)where a point of the parent graph ends up

Point on x²Lands on
(-2, 4)(-1, 7)
(-1, 1)(0, 1)
(0, 0)(1, -1)
(1, 1)(2, 1)
(2, 4)(3, 7)

What each parent does with the knobs

The same four knobs, read on each parent. The tracer always shows where the “important” point of the parent goes.

  • x² and |x|: the vertex goes to (h, k) and the axis of symmetry is the line x = h. When a < 0 the graph opens downwards.
  • √x: the starting point goes to (h, k). The graph exists for x ≥ h when b is positive, and for x ≤ h when b is negative.
  • sin x: the midline is y = k, the highest and lowest points are k + |a| and k − |a|, and the period is 2π ÷ |b|.
  • 2ˣ: the horizontal asymptote is y = k. The graph stays above it when a > 0 and below it when a < 0.

Try it in the simulation

Six short experiments, a minute each.

  • Reset, then set k = 0 and h = 0. You now have y = 2x². Change a from 2 to 0.5 and then to −1. Which points never moved?
  • Choose |x| and set h = −3. Where is the vertex? Predict before you look, using the “bracket is zero” trick.
  • Choose sin x. Set b = 2, then b = 0.5. Read the period. Does it match 2π ÷ |b|?
  • Choose √x and make b negative. The graph now runs to the left. What does the domain reading say?
  • Choose 2ˣ and set k = −3. Where is the asymptote? Turn a negative and watch it flip below the line.
  • Choose any function and set every slider to a different non-zero value. Use the point rule to predict where P′ is when P is at a clear point, then check the dashed line.

Solved problems

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

Problem 1: shift x² up by 3

The new equation is y = x² + 3. Every output is 3 bigger, so the vertex moves from (0, 0) to (0, 3). The table in the “k” section shows five points side by side.

Problem 2: where is the vertex of y = (x − 2)² and of y = (x + 3)²?

Set each bracket to zero. (x − 2) is zero at x = 2, so the first vertex is (2, 0). (x + 3) is zero at x = −3, so the second vertex is (−3, 0). Check with the table: the first graph reads 0 at x = 2 and the second reads 0 at x = −3. Both are U-shapes of the same width, just in different places.

xy = (x − 2)²y = (x + 3)²
-4361
-3250
049
2025
3136

Problem 3: describe y = −3|x|

Start from |x|. The factor −3 stretches it by 3 vertically and flips it over the x-axis, so the V opens downwards with its vertex still at the origin. At x = 2 the parent has height 2 and the new graph has height -6.

Problem 4: periods of y = sin(2x), y = sin(0.50x) and y = 3·sin(2x) + 1

Use period = 2π ÷ |b|. For b = 2 it is 3.14. For b = 0.5 it is 12.57. The parent has period 6.28.

For y = 3·sin(2x) + 1: amplitude 3, period 3.14, midline y = 1. The highest point is 1 + 3 = 4, the lowest is 1 − 3 = -2.

Problem 5: sketch y = −3√(x − 1) + 4

The starting point of √x moves to (1, 4). The factor −3 stretches by 3 and flips, so the curve runs down and to the right from (1, 4). Nothing exists for x < 1. The table checks it.

xy = −3√(x − 1) + 4
0—
14
21
5-2
10-5

Problem 6: intercepts and asymptote of y = 2^(x + 1) − 4

The asymptote is y = −4: the graph climbs away from it on the right and settles towards it on the left. At x = −10 the height is -4, almost −4.

The y-intercept (x = 0) is -2. For the x-intercept set 2^(x + 1) = 4, so x + 1 = 2 and x = 1. Check: at x = 1 the graph reads 0.

Problem 7: a parabola with vertex (2, −3) through (4, 5)

Write y = a(x − 2)² − 3. Substitute the point: 5 = a(4 − 2)² − 3, so 8 = a × 4 and a = 2. The equation is y = 2(x − 2)² − 3.

Check: at x = 4 it gives 5. By symmetry it must also give 5 at x = 0, and it does (5).

Problem 8: does the order of moves matter?

Yes. “Double, then add 3” gives y = 2x² + 3; at x = 1 it reads 5. “Add 3, then double” gives y = 2(x² + 3); at x = 1 it reads 8. In y = a·f(x) + k, the stretch by a is applied first and the shift by k second.

Inside the brackets, factor before you read h. (2x − 3)² is (2(x − 1.50))², so it shifts by 1.50, not by 3. By contrast (2x − 6)² = (2(x − 3))² shifts by 3.

Common mistakes

These cost marks again and again.

  • Reading (x − 2) as “move left 2”. It moves right 2.
  • Reading f(2x) as “twice as wide”. It is half as wide. The x-direction moves are reciprocals.
  • Reading 2(x − 3) and (2x − 3) as the same thing. Factor the b out first, then read h.
  • Forgetting that a negative a flips the graph over the x-axis, and a negative b flips it over the y-axis. For x² and |x|, a flip in the y-axis is invisible because they are symmetric.
  • Applying shifts and stretches in the wrong order. The outside is stretch (a) first, then shift (k).
  • Moving the asymptote or midline by a instead of by k. Only k moves them.

Where transformations show up in real life

The same four knobs appear far outside the classroom.

  • Sound: a note is a sine wave. a is the volume (amplitude), b is the pitch (frequency), h is where in the cycle it starts, and k shifts the whole signal up.
  • Graphics and games: every sprite on screen is the same shape moved (h, k), scaled (a, b) or flipped (negative a or b).
  • Finance: 2ˣ is compound growth. A negative a describes decay of a debt, and k moves the baseline.
  • Physics: a mass on a spring follows a·sin(bt) + k. Tides and daylight hours are the same shape with different knobs.
  • Data science: normalising data is a transformation, subtract the mean (h) and divide by the spread (b).

Exam corner

Transformation questions appear in IGCSE, A-level, SAT, ACT, JEE and HSC higher mathematics. The patterns are predictable.

  • Describe the transformation from y = f(x) to y = f(x − 3) + 2 in words (right 3, up 2).
  • Given a graph and a few points, write the equation.
  • Apply a sequence of moves to a table of points with the point rule.
  • State the new vertex, asymptote, domain, range or period.
  • Multiple choice: spot which of four equations matches a described graph.

Revision summary

Four letters, four moves:

k: up (k > 0) or down (k < 0)

h: right (h > 0) or left (h < 0)

a: vertical stretch by |a|, flip over the x-axis if a < 0

b: horizontal squeeze by 1/|b|, flip over the y-axis if b < 0

(x, y) → (x/b + h, a·y + k)

Frequently asked questions

What is a function transformation?

A transformation changes a function’s graph by shifting, stretching, squeezing or reflecting it. The general form is y = a·f(b(x − h)) + k, where f is the parent function and a, b, h and k are the four knobs.

Why does f(x − 2) move the graph to the right?

Because the output now equals f’s value at an input 2 smaller. The special point that used to happen at x = 0 now happens when x − 2 = 0, which is x = 2. The graph has moved right.

What does a negative a do?

It flips the graph over the x-axis, because every height changes sign. A negative b flips it over the y-axis instead.

How do I find the period after a transformation of sine?

For y = a·sin(b(x − h)) + k the period is 2π ÷ |b|. The amplitude is |a| and the midline is y = k. h and k do not change the period.

In what order do I apply transformations?

Work from the inside out: shift by h, scale by b, apply f, scale by a, then shift by k. With the equation in factored form this order is automatic.

How do I read the vertex from a transformed parabola?

Write the equation as y = a(x − h)² + k. The vertex is (h, k). If the equation is not in that form, complete the square first.

Do horizontal shifts and stretches change the range?

No. The range depends only on a and k, because they act on the outputs. h and b act on the inputs, so they change the domain and the position, but not the set of y-values.

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 11–12

Derivative as the Slope of a Tangent: Secant to Tangent

Drag a point P on x², x³, sin x, eˣ or 1/x and shrink the gap h to zero. Watch the secant become the tangent and its slope become the derivative, with the derivative graph below. Free simulation.

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