S. D. V. Stephens

notes / Integrated Mathematics / chapter 8: Equations, Functions and Graphs

8.4 Piecewise Functions, Basic Graphs and Transformations

Graphing functions defined in pieces, the basic graphs to know by heart, and how shifts, stretches and reflections move them.

Piecewise functions

Example 8.4.1.

Show solution
Graph of the piecewise function equal to x cubed for x < 1 and 3x - 2 for x >= 1, through (-1,-1), (0,0), (1,1) and (3,7); a dotted line at x = 1 marks where the rule changes.

The dotted line at is not a vertical asymptote; it marks where the rule switches from to .

Example 8.4.2.

Show solution
Graph of the piecewise function equal to x squared for x < 0, 2 at x = 0 and 2x + 1 for x > 0: open circles at (0,0) and (0,1), a closed point at (0,2), and the points (-2,4) and (2,5).

Example 8.4.3.

Show solution

![Graph of the piecewise function x + 3 on -4,-2) and -2x - 3 for x >= -2

Functions you need to know

Eight basic graphs with their key points: the constant f(x)=b, f(x)=x^2, f(x)=x, f(x)=|x|, f(x)=x^3, f(x)=sqrt(x), f(x)=cube root of x, and f(x)=1/x with its vertical asymptote x=0 and horizontal asymptote y=0.

For : the -axis is a vertical asymptote and the -axis is a horizontal asymptote.

Shifts, stretches and reflections

Four shifted graphs: x^2+3 (vertex at (0,3)), |x+2| (vertex at (-2,0)), (x+1)^3-1 (centred at (-1,-1)), and sqrt(x-2)+3 (starting at (2,3)).
Formula Effect
Vertical shift up
shift down
Horizontal shift left
shift right

Vertical stretch/compression: .

  • : stretch: the graph grows and narrows.
  • : compression: the graph shrinks and widens.

Horizontal stretch/compression: .

  • : horizontal compression: the graph narrows.
  • : horizontal stretch: the graph widens.

Reflection:

  • reflects on the -axis.
  • reflects on the -axis.

Examples: , with key points , , ; ; ; , with key points , , ; and .

Four graphs: 2x^2 through (-1,2), (0,0), (1,2); the reflected cube root -cbrt(x); (1/2)x^3 through (-1,-1/2), (0,0), (1,1/2); and sqrt(-x), which starts at the origin and runs to the left.

Note. Things within parentheses have counter-intuitive effects. Ex: shifts left, and shrinks horizontally and narrows.

Combining transformations

Several transformations at once, applied to the key points of the basic graph.

Example 8.4.4.

Show solution

The transformations of :

  1. Up 2 units.
  2. Right 3 units.
  3. Vertical compression .
  4. Reflection about the -axis.

Key points (multiply each by ):

Then shift right 3 units and up 2 units:

Graph of f(x) = -(1/2)|x-3| + 2: an upside-down V with vertex (3,2) through (2,1.5), (4,1.5) and (0,1/2), with arrows showing the shift right 3 units and up 2 units.

Example 8.4.5.

Show solution
  1. Down 1.
  2. Left 1.
  3. Vertical compression.
  4. Reflection about the -axis.

Key points:

Graph of g(x) = -(1/3)(x+1)^3 - 1: a decreasing cubic centred at (-1,-1), through (-2,-2/3) and (0,-4/3).

Example 8.4.6.

Show solution
  1. Up 1.
  2. Right 2.
  3. Vertical stretch.

Key points:

The VA at moves to , and the HA at moves to .

Graph of f(x) = 3/(x-2) + 1 with dashed asymptotes x = 2 and y = 1 and the key points (1,-2) and (3,4).

Example 8.4.7.

Show solution

Rewrite as .

  1. Up 3.
  2. Right 1.
  3. Vertical stretch.
  4. Reflection about the -axis.

Key points:

Graph of g(x) = 2 sqrt(1-x) + 3: starts at (1,3), passes through (0,5) and rises slowly to the left.