Function Transformation Calculator - Shifts & Stretches

The template

g(x) = a·f( b(x h) ) + k

f(x) = x² · vertex at (0, 0)

Try a transformation

avertical stretch / flip

Outside the function. Negative flips it over the x-axis.

bhorizontal squash / flip

Inside the function. The graph scales by 1/b, not by b.

hhorizontal shift

Written as (x − h). Positive h moves the graph right.

kvertical shift

Outside the function. Positive k moves the graph up.

Transformed function

g(x) = −2(x − 3)² + 1

Expanded: g(x) = −2x² + 12x − 17

−4−2246−15−10−55
Parent f(x) = x²Transformed g(x)

What happens to , in order

Horizontal work happens first inside the brackets, vertical work afterwards. Within each pair, scale before you shift.

  1. 1

    Shift right 3 units

    The equation carries (x − 3) inside the function, yet the graph travels right. Inside changes always run opposite to the sign you read.

  2. 2

    Vertical stretch by a factor of 2

    Every y-coordinate is multiplied by 2. Points already on the x-axis stay put — a stretch cannot move a zero.

  3. 3

    Reflection across the x-axis

    (x, y) becomes (x, −y). The curve flips upside down about the x-axis.

  4. 4

    Shift up 1 unit

    The + 1 sits outside the function, so it moves the whole graph up by exactly that much.

Domain of g

(−∞, ∞)

Accepts every real number.

Range of g

(−∞, 1]

Produces y ≤ 1.

Where the key points land

(x, y) → (x + 3, −2y + 1)

Point on f(x)Point on g(x)
(−2, 4)(1, −7)
(−1, 1)(2, −1)
(0, 0)(3, 1)
(1, 1)(4, −1)
(2, 4)(5, −7)

How to Use This Calculator

  1. Choose the Parent function f(x) your problem starts from — x², |x|, √x, 1/x, eˣ, ln x, sin x, cos x, x³ or plain x.
  2. Set a and k for the vertical work: a stretches or flips, k slides up and down. Both sit outside f, so they behave exactly as written.
  3. Set b and h for the horizontal work. Factor first — f(2x − 6) has b = 2 and h = 3, not h = 6.
  4. Drag any slider and watch the emerald curve move against the dashed parent. The numbered list underneath rewrites itself in the order a teacher would mark.
  5. Check Domain of g and Range of g — b and h move the domain, a and k move the range, and the point table shows the same arithmetic applied to five specific coordinates.

Share this calculator

Help others solve their calculations

Found this calculator helpful? Share it with your friends, students, or colleagues who might need it!

A Function Transformation Calculator Only Ever Solves One Equation

About the Author

Marko Šinko - Co-Founder & Lead Developer

Marko Šinko

Co-Founder & Lead Developer, AI Math Calculator

Lepoglava, Croatia
Advanced Algorithm Expert

Croatian developer with a Computer Science degree from University of Zagreb and expertise in advanced algorithms. Co-founder of award-winning projects, ensuring precise mathematical computations and reliable calculator tools.

📅 Published:
Function Transformation Calculator graphing a parent curve against its shifted, stretched and reflected image on one set of axes

A function transformation calculator reads four numbers out of a single template: g(x) = a·f(b(x h)) + k. Set a = 3 and the graph triples in height. Set k = 5 and it drops five units. Touch b or h and the graph still moves — but sideways, backwards, and by an amount that is often not the number sitting in front of you.

Those four letters cover every shift, stretch, compression and reflection in the Algebra 2 and precalculus syllabus. There is no separate rule for parabolas, no second rule for absolute values, no third for sine waves. Swap the parent function and the arithmetic is identical. What follows is the anatomy of that template: which half of the graph each letter owns, a parent-function table you can read straight off, why f(2x 6) shifts by 3 rather than 6, and how to run the whole thing backwards when a graph is handed to you without an equation.

Which Half of the Graph Each Letter Owns

Split the template at the function name. Anything outside f acts on outputs, so it changes y-coordinates and does exactly what it says. Anything inside f acts on inputs, so it changes x-coordinates and does the opposite of what it says. That single division explains every rule below.

LetterPositionEffectReads as written?
aOutside, multiplyingVertical stretch by |a|; flips over the x-axis if a < 0Yes — a = 3 means three times as tall
kOutside, addedVertical shiftYes — k = 4 means up 4
bInside, multiplying xHorizontal scale by 1/|b|; flips over the y-axis if b < 0No — b = 3 squeezes to one third
hInside, subtracted from xHorizontal shiftNo — (x 4) means right 4

Put numbers on it. Suppose the point (2, 5) sits on f. Under g(x) = 3f(x) it becomes (2, 15): the input never changed, only the output tripled. Under g(x) = f(3x) it becomes (2/3, 5) instead — the output is untouched and the input shrank to a third. Same 3, opposite halves of the coordinate, and a good reason to sketch both on a graphing calculator before trusting your instinct.

Ten Parent Graphs and the Anchor Point That Pins Each One

Transformations only make sense relative to a starting shape. These ten parents cover essentially every problem set, and each one has an anchor — the single feature you track first, because once you know where the anchor went, the rest of the curve follows.

ParentDomainRangeAnchor to track
x(∞, ∞)(∞, ∞)Passes through (0, 0)
(∞, ∞)[0, ∞)Vertex (0, 0)
(∞, ∞)(∞, ∞)Inflection (0, 0)
|x|(∞, ∞)[0, ∞)Corner (0, 0)
√x[0, ∞)[0, ∞)Endpoint (0, 0)
1/xx ≠ 0y ≠ 0Asymptote cross (0, 0)
(∞, ∞)(0, ∞)y-intercept (0, 1)
ln x(0, ∞)(∞, ∞)x-intercept (1, 0)
sin x(∞, ∞)[1, 1]Zero crossing (0, 0)
cos x(∞, ∞)[1, 1]Maximum (0, 1)

Seven of the ten anchor at the origin. That is not a coincidence, and it is the shortcut worth memorising: whenever the anchor sits at (0, 0), it lands at exactly (h, k) after the transformation, because b never touches an x-coordinate of zero and a never touches a y-coordinate of zero. It is why the vertex of a parabola in the form a(x h)² + k can be read off without any algebra at all. The three exceptions — eˣ, ln x and cos x — need one extra step, because their anchors start off-origin. OpenStax’s precalculus chapter on transformation of functions works through the same parent library with additional practice sets.

Solve for x and the Backwards Rule Stops Being Strange

Students are usually told that (x 4) moves the graph right and then asked to accept it. There is no need. Ask the only question that matters: which input to g produces the output the parent gave at x = 1?

For g(x) = f(x 4) you need x 4 = 1, so x = 5. The behaviour that used to live at 1 now lives at 5 — four steps to the right. The minus sign is not describing the motion of the graph. It is describing what you must undo to get back to the parent, and undoing a subtraction means adding.

The same argument settles b. For g(x) = f(2x) you need 2x = p, so x = p/2, and every feature of the parent lands at half its old distance from the y-axis. Try it on √x: the endpoint at (0, 0) stays at 0 because half of nothing is still nothing, while the point (9, 3) slides in to (4.5, 3). The curve gets narrower without getting shorter. On an absolute value graph the effect is easier still to see — the V gets visibly steeper while the corner refuses to budge.

f(2x 6) Shifts by 3, Not 6

This is the error that costs the most marks, and it is not a conceptual error — it is a failure to factor. The template requires b(x h), a product, not a difference. So 2x 6 has to become 2(x 3) before you read anything off it. The shift is 3. Write the unfactored 6 and every point on your sketch is off by three units.

Order matters vertically too, and there the arithmetic is genuinely different rather than just misread. Take a point where f(1) = 5. Stretch by 2 and then add 3, and you get 2(5) + 3 = 13. Add 3 first and then stretch, and you get 2(5 + 3) = 16. Three units of difference, from nothing but the sequence.

Written asIn template formWhat actually happens
f(2x 6)f(2(x 3))Squash to half width, then right 3
f(2(x 6))already factoredSquash to half width, then right 6
f(2x) 6b = 2, k = 6Squash to half width, then down 6
2f(x) + 3a = 2, k = 3Stretch ×2, then up 3
2(f(x) + 3)a = 2, k = 6Up 3 first, so the net rise is 6

The safe habit is the one the calculator above enforces: scale before you shift, on both axes, and factor the inside of the bracket before you read h. Trig questions punish this hardest, since the horizontal squash is the period and the shift is the phase — see the amplitude, period and phase shift calculator for how the same factoring step produces the phase shift b·h rather than h.

Track Five Points Instead of the Whole Curve

Nobody transforms a curve. You transform a handful of points and join them up. Every point (p, q) on the parent moves to (p/b + h, a·q + k) — divide by b and add h horizontally, multiply by a and add k vertically.

Run g(x) = 2(x 3)² + 1 through it. Here a = 2, b = 1, h = 3, k = 1, so the rule collapses to (x + 3, 2y + 1):

On x²ArithmeticOn g
(2, 4)(2+3, 2·4+1)(1, 7)
(1, 1)(1+3, 2·1+1)(2, 1)
(0, 0)(0+3, 0+1)(3, 1)
(1, 1)(1+3, 2·1+1)(4, 1)
(2, 4)(2+3, 2·4+1)(5, 7)

Five points, one downward parabola, vertex at (3, 1) — which you could have read straight off the equation, since the anchor was at the origin. That is precisely what vertex form is: the transformation template written for a single parent. Notice the symmetry survives too. (1, 7) and (5, 7) are still mirror images, just about x = 3 instead of x = 0.

Only Two of the Four Letters Can Touch the Domain

Domain lives on the x-axis, range lives on the y-axis, and each letter only works on one axis. So b and h are the only letters that can change a domain, and a and k are the only ones that can change a range. Half the questions on this topic are testing exactly that split.

Take f(x) = √x with domain [0, ∞). Build g(x) = √(2(x 1)). The inside must stay non-negative, so 2(x 1) ≥ 0 gives x ≤ 1 and the domain flips to (∞, 1]. The range never budges from [0, ∞) — a is 1 and k is 0, so no output was ever touched. Compare that with g(x) = 3 sin x 4, where the domain stays every real number and the range compresses to [7, 1].

Rational and logarithmic parents behave the same way, except their restrictions show up as asymptotes rather than endpoints. Shifting 1/x by h moves the vertical asymptote to x = h; adding k moves the horizontal one to y = k. Both facts fall straight out of the domain and range mapping, and the asymptote calculator shows the same result from the rational-function side. Work through a few examples with the domain and range calculator and the pattern gets obvious fast.

Reading the Four Numbers Off a Graph You Were Given

Exams love the reverse direction: here is a curve, write its equation. Five steps get you there without guessing.

  1. Name the parent from the shape. A sharp corner means |x|. A smooth U means x². A curve that simply stops means √x. Two branches fleeing a pair of asymptotes means 1/x. An S-bend through a flat spot means x³.
  2. Find the anchor and subtract. Corner at (1, 4) against a parent corner at (0, 0) gives h = 1 and k = 4 immediately.
  3. Take one step right from the anchor. On x² and |x| the parent rises 1 over that step. If your graph rises 3 instead, |a| = 3; if it rises 0.5, |a| = 0.5.
  4. Check which way it opens. Downward or upside down means a is negative.
  5. Only then consider b. Most textbook answers set b = 1 on purpose.

That last step deserves a warning, because it is the part most explanations skip. For every power-type parent — x, x², x³, √x, |x| and 1/x — a and b are not independently recoverable from a picture. Since (bx)ⁿ = bⁿ·xⁿ, squashing a parabola to half its width produces literally the same curve as stretching it vertically by 4. Nothing in the graph can separate them, so convention sets b = 1 and pushes the whole effect into a.

Exponentials and logs hide a different swap. Because e^(x h) = e^(h)·eˣ, a horizontal shift on eˣ is a vertical stretch wearing a disguise; because ln(bx) = ln b + ln x, a horizontal squash on a log is really a vertical shift. Only the trig family keeps all four parameters genuinely distinct, since no vertical scaling can change a period — which is exactly why phase-shift questions insist on the factored form. If you need to go the other way and undo a transformation entirely, the inverse function calculator and the function calculator handle the algebra.

Five Errors No Function Transformation Calculator Will Catch For You

A calculator transforms whatever you hand it. If you hand it the wrong h, it draws the wrong graph without complaint. These five slips all happen before the arithmetic starts.

  • Reading (x + 5) as a shift right. It is a shift left 5. The resulting sketch is wrong by 10 units, and every intercept, vertex and asymptote you report afterwards inherits the error.
  • Not factoring before reading h. f(3x + 12) is f(3(x + 4)), so the shift is 4 left, not 12. This one shows up in disguise on every phase-shift question.
  • Shifting before stretching. 2f(x) + 3 and 2(f(x) + 3) differ by a constant 3 at every single point. Marked as a graphing question, that is a whole curve in the wrong place.
  • Reflecting an even function and expecting a change. Setting b = 1 on x², |x| or cos x produces a graph identical to the original, because those functions already satisfy f(x) = f(x). The working looks impressive and achieves nothing.
  • Leaving the domain behind. Writing the domain of √(x 4) as [0, ∞) instead of [4, ∞) is the single most common mark lost on logarithm and radical questions. The restriction moves with the graph.

Every one of these is visible in under a second on the graph above. Change one letter, watch the emerald curve leave the dashed one, and check whether it moved the way you predicted. If it did not, the numbered list underneath will tell you which of the four letters you had backwards.

Frequently Asked Questions

Still Have Questions?

The detailed content on this page provides comprehensive explanations and examples to help you understand better.