Type to search, in English or Thai

  1. Home
  2. English lessons
  3. Precalculus
  4. Graphs and transformations

// Chapter 27.3 · Precalculus · Graphs & Transformations

Graphs of Functions and Transformations: Shifts, Stretches, Reflections, Symmetry, Even and Odd Functions, and Lines

If you know the shapes of ten parent graphs and understand what the numbers a, b, h and k do in y=a f(b(x−h))+ky = a\,f\big(b(x - h)\big) + k, you can sketch hundreds of other functions without plotting point after point. This page starts by reading a graph for all the information it holds, reviews lines and circles, the graphs you meet most often, and then takes shifts, stretches and reflections one at a time, with a lab where dragging a slider visibly moves each point of the graph.

By Ajarn ModUpdated
In 30 seconds
  • f(x)+kf(x) + k up k · f(x−h)f(x - h) right h · af(x)a f(x) vertical stretch by a · f(bx)f(bx) horizontal compression by 1/b
  • −f(x)-f(x) reflects in the x-axis · f(−x)f(-x) reflects in the y-axis
  • The parent point (x,y)(x, y) goes to (xb+h, ay+k)\left(\tfrac{x}{b} + h,\ a y + k\right)
  • Even: f(−x)=f(x)f(-x) = f(x), y-axis symmetry · odd: f(−x)=−f(x)f(-x) = -f(x), origin symmetry
  • Parallel: m1=m2m_1 = m_2 · perpendicular: m1m2=−1m_1 m_2 = -1

Reading a graph completely

One graph answers many questions at once. The domain is the shadow of the graph on the x-axis and the range is its shadow on the y-axis. The x-intercepts solve f(x)=0f(x) = 0 and the y-intercept is f(0)f(0). Where the graph climbs as you read left to right the function is increasing, and local maxima and minima are where it turns. This skill matters more than calculation: in calculus you will use derivatives to find these features, and you need to know what you are looking for on the graph.

G1 Reading a graph

x-int:f(x)=0,y-int:(0,f(0)),x1<x2⇒f(x1)<f(x2) (increasing)x\text{-int}: f(x) = 0,\quad y\text{-int}: (0, f(0)),\quad x_1 < x_2 \Rightarrow f(x_1) < f(x_2)\ \text{(increasing)}

Lines, slope and circles

Slope is rise over run, m=Δy/Δxm = \Delta y/\Delta x, the average rate of change that stays the same along a whole line. A line has several equation forms and each suits different information: with a slope and a point use point–slope form; to read the y-intercept use y=mx+cy = mx + c. The circle is a graph that is not a function, but it is used constantly in analytic geometry and as the unit circle of trigonometry.

G2 Lines

m=y2−y1x2−x1,y−y1=m(x−x1),y=mx+c,Ax+By=Cm = \frac{y_2 - y_1}{x_2 - x_1},\quad y - y_1 = m(x - x_1),\quad y = mx + c,\quad Ax + By = C

G3 Parallel & perpendicular

ℓ1∥ℓ2  ⟺  m1=m2,ℓ1⊥ℓ2  ⟺  m1m2=−1\ell_1 \parallel \ell_2 \iff m_1 = m_2,\qquad \ell_1 \perp \ell_2 \iff m_1 m_2 = -1

G4 Distance & midpoint

d=(x2−x1)2+(y2−y1)2,M=(x1+x22, y1+y22)d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2},\quad M = \left(\tfrac{x_1 + x_2}{2},\ \tfrac{y_1 + y_2}{2}\right)

G5 Circle

(x−h)2+(y−k)2=r2(x - h)^2 + (y - k)^2 = r^2

From x2+y2+Dx+Ey+F=0x^2 + y^2 + Dx + Ey + F = 0, complete the square in x and in y

Example G-1 · A perpendicular line

Find the line through (2,−1)(2, -1) perpendicular to 3x−4y=123x - 4y = 12

  1. Rewrite the given line as y=34x−3y = \tfrac34 x - 3: slope m1=34m_1 = \tfrac34

  2. Perpendicular slope m2=−43m_2 = -\tfrac43 (G3)

  3. Point–slope form: y+1=−43(x−2)⇒y=−43x+53y + 1 = -\tfrac43(x - 2) \Rightarrow y = -\tfrac43 x + \tfrac53

y=−43x+53y = -\tfrac43x + \tfrac53, or 4x+3y=54x + 3y = 5 (check: 4(2)+3(−1)=54(2) + 3(-1) = 5)

Example G-2 · Circle from general form

Find the centre and radius of x2+y2−6x+4y−12=0x^2 + y^2 - 6x + 4y - 12 = 0

  1. Group: (x2−6x)+(y2+4y)=12(x^2 - 6x) + (y^2 + 4y) = 12

  2. Complete the squares: (x2−6x+9)+(y2+4y+4)=12+9+4(x^2 - 6x + 9) + (y^2 + 4y + 4) = 12 + 9 + 4

  3. So (x−3)2+(y+2)2=25(x - 3)^2 + (y + 2)^2 = 25

Centre (3,−2)(3, -2), radius 5

Parent functions to know by sight

Parent functions are the basic shapes that get shifted, stretched and reflected. For each, remember three things: the shape, two or three key points, and the domain and range. Each one can be selected in the lab below; the table puts them side by side.

FunctionKey pointsDomainRangeSymmetry
xx(0, 0), (1, 1)R\mathbb RR\mathbb Rodd
x2x^2(0, 0), (±1, 1), (±2, 4)R\mathbb R[0,∞)[0, \infty)even
x3x^3(0, 0), (±1, ±1)R\mathbb RR\mathbb Rodd
∣x∣|x|(0, 0), (±1, 1)R\mathbb R[0,∞)[0, \infty)even
x\sqrt{x}(0, 0), (1, 1), (4, 2)[0,∞)[0, \infty)[0,∞)[0, \infty)—
x3\sqrt[3]{x}(0, 0), (±1, ±1), (8, 2)R\mathbb RR\mathbb Rodd
1x\tfrac1x(1, 1), (−1, −1)x≠0x \ne 0y≠0y \ne 0odd
2x2^x(0, 1), (1, 2), (−1, ½)R\mathbb R(0,∞)(0, \infty)—
log⁡2x\log_2 x(1, 0), (2, 1), (½, −1)(0,∞)(0, \infty)R\mathbb R—
sin⁡x\sin x(0, 0), (π/2, 1), (π, 0)R\mathbb R[−1,1][-1, 1]odd

Shifts, stretches and reflections

Transformations come in two kinds. Those applied outside the function, a and k, act on the y-value directly, so the graph moves vertically just as you would expect. Those applied inside, b and h, act on x before it enters f, so the graph moves horizontally the opposite way: subtracting h moves it right, multiplying by b squeezes it. The reason is that the new graph has to wait until b(x−h)b(x - h) equals the old x to produce the old y.

G6 Shifts

y=f(x)+k  (↑k),y=f(x−h)  (→h)y = f(x) + k\ \ (\uparrow k),\qquad y = f(x - h)\ \ (\rightarrow h)

G7 Stretches

y=af(x): vertical stretch by ∣a∣,y=f(bx): horizontal compression by 1∣b∣y = a f(x):\ \text{vertical stretch by } |a|,\qquad y = f(bx):\ \text{horizontal compression by } \tfrac{1}{|b|}

G8 Reflections

y=−f(x): reflect in the x-axis,y=f(−x): reflect in the y-axisy = -f(x):\ \text{reflect in the } x\text{-axis},\qquad y = f(-x):\ \text{reflect in the } y\text{-axis}

G9 Combined

y=a f(b(x−h))+k:(x, y) ⟼ (xb+h,  ay+k)y = a\,f\big(b(x - h)\big) + k:\qquad (x,\ y) \ \longmapsto\ \left(\frac{x}{b} + h,\ \ a y + k\right)

For f(bx−c)f(bx - c) factor out b first: f(b(x−cb))f\big(b(x - \tfrac{c}{b})\big), so the shift is cb\tfrac{c}{b}, not c

Example G-3 · Describing a transformation

Describe how y=−2x+3+1y = -2\sqrt{x + 3} + 1 is obtained from y=xy = \sqrt x and give key points, domain and range

  1. Compare with G9: a=−2, b=1, h=−3, k=1a = -2,\ b = 1,\ h = -3,\ k = 1

  2. Steps: shift left 3 → stretch vertically by 2 → reflect in the x-axis → shift up 1

  3. Move points (x,y)↦(x−3, −2y+1)(x, y) \mapsto (x - 3,\ -2y + 1): (0,0)↦(−3,1)(0, 0) \mapsto (-3, 1), (1,1)↦(−2,−1)(1, 1) \mapsto (-2, -1), (4,2)↦(1,−3)(4, 2) \mapsto (1, -3)

  4. The domain starts at −3; the range is flipped below the starting height y=1y = 1

Domain [−3,∞)[-3, \infty), range (−∞,1](-\infty, 1]

Example G-4 · The horizontal-compression trap

How is y=∣2x−4∣y = |2x - 4| obtained from y=∣x∣y = |x|, and where is the vertex?

  1. Factor out 2: ∣2x−4∣=∣2(x−2)∣|2x - 4| = |2(x - 2)|, so b=2, h=2b = 2,\ h = 2

  2. Compress horizontally by ½, then shift right 2 (not 4)

  3. Vertex (0,0)↦(0/2+2, 0)=(2,0)(0, 0) \mapsto (0/2 + 2,\ 0) = (2, 0); check: ∣2(2)−4∣=0|2(2) - 4| = 0

Vertex (2,0)(2, 0), and the V is twice as steep (since ∣2(x−2)∣=2∣x−2∣|2(x - 2)| = 2|x - 2|)

Example G-5 · Moving one point

The point (4,1)(4, 1) lies on y=f(x)y = f(x). Which point must lie on y=f(2x)−3y = f(2x) - 3?

  1. b=2, k=−3b = 2,\ k = -3: (x,y)↦(x/2, y−3)(x, y) \mapsto (x/2,\ y - 3)

  2. Check: at x=2x = 2, f(2⋅2)−3=f(4)−3=1−3=−2f(2\cdot2) - 3 = f(4) - 3 = 1 - 3 = -2

(2,−2)(2, -2)

Transformation lab: drag and watch the points move

Grey open circles are key points of the parent graph and orange dots are where those same points end up. The table under the graph lists both coordinates. Make b negative to see a reflection in the y-axis, and choose 1/x, 2ˣ or log₂x to watch the asymptotes move with h and k.

Common traps(1) Reading f(x+3)f(x + 3) as a shift right by 3 · (2) reading f(2x−4)f(2x - 4) as a shift by 4 instead of factoring out 2 and shifting by 2 · (3) doing the vertical shift before the stretch in 2f(x)+12f(x) + 1: shifting first gives 2(f(x)+1)=2f(x)+22(f(x) + 1) = 2f(x) + 2, a different graph.

Symmetry, even and odd functions

Knowing that a graph is symmetric halves the work, since you can draw the right half and reflect it. In calculus, symmetry also gives integrals over symmetric intervals for free; the integral of an odd function from −a to a is zero. To test, replace x by −x and compare with the original formula.

G10 Even & odd

even: f(−x)=f(x)  (y-axis),odd: f(−x)=−f(x)  (origin)\text{even: } f(-x) = f(x)\ \ (y\text{-axis}),\qquad \text{odd: } f(-x) = -f(x)\ \ (\text{origin})

even × even = even · odd × odd = even · even × odd = odd · an odd function defined at 0 passes through (0, 0)

G11 Symmetry tests

y→−y: x-axis,x→−x: y-axis,(x,y)→(−x,−y): originy \to -y:\ x\text{-axis},\quad x \to -x:\ y\text{-axis},\quad (x, y) \to (-x, -y):\ \text{origin}
Example G-6 · Even, odd or neither

Test f(x)=x4−3x2f(x) = x^4 - 3x^2, g(x)=x3+xg(x) = x^3 + x, h(x)=x2+xh(x) = x^2 + x

  1. f(−x)=x4−3x2=f(x)f(-x) = x^4 - 3x^2 = f(x): even

  2. g(−x)=−x3−x=−g(x)g(-x) = -x^3 - x = -g(x): odd

  3. h(−x)=x2−xh(-x) = x^2 - x, which equals neither h(x)h(x) nor −h(x)=−x2−x-h(x) = -x^2 - x

f even · g odd · h neither

Practice (with answers)

1Line through (−1, 4) and (3, −4)

m=−84=−2m = \tfrac{-8}{4} = -2 · y−4=−2(x+1)y - 4 = -2(x + 1)

y=−2x+2y = -2x + 2

2Vertex of y=3(x+1)2−5y = 3(x + 1)^2 - 5 and which way it opens

h=−1, k=−5, a=3>0h = -1,\ k = -5,\ a = 3 > 0

(−1,−5)(-1, -5), opens up, narrower than x2x^2

3Asymptotes of y=1x−2+3y = \tfrac{1}{x - 2} + 3

1x\tfrac1x shifted right 2 and up 3

x=2x = 2 and y=3y = 3

4Is f(x)=xx2+1f(x) = \dfrac{x}{x^2 + 1} even or odd?

f(−x)=−xx2+1=−f(x)f(-x) = \dfrac{-x}{x^2 + 1} = -f(x)

Odd

5Reflect y=x2y = x^2 in the x-axis, shift right 1 and up 4

a=−1, h=1, k=4a = -1,\ h = 1,\ k = 4

y=−(x−1)2+4y = -(x - 1)^2 + 4

6Distance between (1, −2) and (7, 6)

36+64\sqrt{36 + 64}

10

Read next

Frequently asked questions

Why does f(x − 2) shift the graph right and not left?

y = f(x − 2) reproduces the old value f(0) only when x − 2 = 0, that is at x = 2. Every point of the original graph therefore appears 2 units later, which is 2 units to the right. Changes made to x inside the function always act in the opposite direction to what you might expect, for shifts and for stretches.

In what order should I apply several transformations?

For y = a·f(b(x − h)) + k, do the horizontal changes from the inside out (stretch or compress by b, then shift by h) and the vertical changes in the usual order (stretch or reflect by a, then shift by k). The method that never fails is to move each key point (x, y) of the parent graph to (x/b + h, a·y + k).

How do I recognise even and odd functions?

An even function satisfies f(−x) = f(x) and is symmetric about the y-axis, like x² and cos x. An odd function satisfies f(−x) = −f(x) and is symmetric about the origin, like x³ and sin x. If replacing x by −x gives neither, the function is neither even nor odd, which is the case for most functions.

When are two lines perpendicular?

When the product of their slopes is −1, so one slope is the negative reciprocal of the other: 3/4 is perpendicular to −4/3. The exception is a horizontal line and a vertical line, which are perpendicular although a vertical line has no slope.

Ajarn Mod · Teerawut Savangboon
Lecturer in Electrical Engineering, Dhonburi Rajabhat University, Samut Prakan · Profile