Unit 3, lesson 26

Reading and Drawing Piecewise Functions

How to read a piecewise rule by checking the input conditions first, evaluate it at any input, and draw its graph with the right open and closed endpoints, jumps and joins.

  • Theory part 51
  • Practice part 52
  • Piecewise, Polynomial, and Rational Graphs

A parking garage charges a flat fee for the first hour and a different hourly rate after that. A tax schedule uses one rate up to some income and another rate above it. These are piecewise functions, one rule for some inputs and another rule for the rest. The whole skill is to look at the input first, decide which rule applies, and only then compute.

Key terms

Piecewise function

Definition A piecewise function is a function defined by several formulas, each paired with a condition on the input. Written out, it looks like

f(x)={x2,x<1,4−x,x≥1.f(x) = \begin{cases} x^2, & x < 1, \\ 4 - x, & x \ge 1. \end{cases}

The domain of ff is the set of inputs that satisfy at least one of the conditions. For the rule to define a function, every input in the domain must receive exactly one output. This holds automatically when the conditions do not overlap. If two conditions overlap, their formulas must give the same value at every input in the overlap.

In plain words It is still one function. It simply uses different instructions on different parts of the number line, and the instructions never contradict each other.

Example The rule

h(x)={x2,x≤1,2x−1,x≥1h(x) = \begin{cases} x^2, & x \le 1, \\ 2x - 1, & x \ge 1 \end{cases}

has overlapping conditions at x=1x = 1, but both formulas give 11 there, so it defines a function. If the second formula were x+1x + 1 instead, the input 11 would receive both 11 and 22, and the rule would not be a function.

Input condition

Definition An input condition is the statement about xx written next to a formula, such as x<1x < 1, x≥1x \ge 1 or −2≤x<3-2 \le x < 3. A formula is used for exactly those inputs that make its condition true. An input that satisfies no condition is not in the domain, even if some formula could be evaluated there.

In plain words The conditions are the gatekeepers. Read them before you look at any formula.

Example For

k(x)={−1,x<0,1,x>0,k(x) = \begin{cases} -1, & x < 0, \\ 1, & x > 0, \end{cases}

no condition allows x=0x = 0, so k(0)k(0) is undefined and 00 is not in the domain. The domain is (−∞,0)∪(0,∞)(-\infty, 0) \cup (0, \infty), even though both formulas are constants that could be written down for any input.

Rule selection

Definition To evaluate a piecewise function at an input aa, first find the condition that aa satisfies, then substitute aa into the formula paired with that condition and only that formula. If aa satisfies no condition, the function has no value at aa.

In plain words Pick the rule, then plug in. Never plug into a formula whose condition is false for your input.

Example For f(x)=x2f(x) = x^2 when x<1x < 1 and f(x)=4−xf(x) = 4 - x when x≥1x \ge 1,

InputCondition it meetsFormula usedOutput
−2-2x<1x < 1x2x^244
12\frac{1}{2}x<1x < 1x2x^214\frac{1}{4}
11x≥1x \ge 14−x4 - x33
55x≥1x \ge 14−x4 - x−1-1

A common slip is to compute f(1)=12=1f(1) = 1^2 = 1. That uses the wrong rule, because 1<11 < 1 is false.

Branch

Definition A branch of a piecewise function is the part of its graph produced by one formula on the inputs allowed by its condition. The graph of the whole function is the union of its branches. A formula’s curve outside its condition is not part of the graph.

In plain words Each formula contributes only a piece of its usual curve. Draw that piece and stop where the condition stops.

Example For the function ff above, the first branch is the part of the parabola y=x2y = x^2 to the left of x=1x = 1, and the second is the part of the line y=4−xy = 4 - x from x=1x = 1 onward. The rest of the parabola, such as the point (2,4)(2, 4), does not belong to the graph. If you sketch the whole parabola lightly as a guide, erase it or keep it clearly separate from the final graph.

Closed and open endpoints

Definition Where a branch ends at an input cc, the endpoint (c,value of that formula at c)(c, \text{value of that formula at } c) is included in the graph exactly when the condition includes equality at cc, as in x≤cx \le c or x≥cx \ge c. It is drawn as a filled dot, a closed endpoint. When the condition is strict, as in x<cx < c or x>cx > c, the point is not on that branch and is drawn as a hollow dot, an open endpoint.

In plain words Equality in the condition means the dot is filled. Strict inequality means the branch gets as close as you like but leaves a hole.

Example For ff above, the first branch heads toward (1,1)(1, 1), since 12=11^2 = 1, but its condition x<1x < 1 excludes x=1x = 1. That gets a hollow dot at (1,1)(1, 1). The second branch starts at (1,3)(1, 3), since 4−1=34 - 1 = 3, and its condition x≥1x \ge 1 includes x=1x = 1. That gets a filled dot at (1,3)(1, 3). So the graph has exactly one point above x=1x = 1, which is (1,3)(1, 3), in agreement with f(1)=3f(1) = 3.

Switching input

Definition A switching input is a value of xx where the condition in force changes, so the function stops using one formula and starts using another. At a switching input cc you check three numbers separately, the value the left formula approaches as x→cx \to c from the left, the value the right formula approaches as x→cx \to c from the right, and the actual value f(c)f(c) given by whichever condition includes cc.

In plain words The switch is where all the interesting behavior happens. Check the boundary on its own rather than trusting the sketch.

Example For ff above the switching input is 11. The left formula x2x^2 approaches 11, the right formula 4−x4 - x approaches 33, and the actual value is f(1)=3f(1) = 3. These three numbers tell you everything about the graph near x=1x = 1.

Matching branch values

Definition The branch values match at a switching input cc when the left formula and the right formula approach the same number as xx approaches cc from their own sides, and that number is also f(c)f(c). For polynomial formulas such as these, the number a formula approaches is simply its value at cc. Then the branches meet at a single point and the graph has no break at cc. Matching values do not mean the graph is smooth there. The branches can meet at an angle and form a corner.

In plain words If both pieces arrive at the same height and the function’s own value is that height, you can draw through the switch without lifting your pencil.

Example Consider

g(x)={x2,x≤2,2x,x>2.g(x) = \begin{cases} x^2, & x \le 2, \\ 2x, & x > 2. \end{cases}

At x=2x = 2 the left formula gives 22=42^2 = 4 and the right formula gives 2⋅2=42 \cdot 2 = 4, and g(2)=4g(2) = 4. The branches join at (2,4)(2, 4), drawn with a single filled dot. They do not join smoothly, though. A chord from (2,4)(2, 4) to a point (t,t2)(t, t^2) on the left branch has slope

4−t22−t=2+t,\frac{4 - t^2}{2 - t} = 2 + t,

which is 3.93.9 at t=1.9t = 1.9 and 3.993.99 at t=1.99t = 1.99, so the left branch arrives tilted at a slope near 44. Every chord on the right branch has slope 22. The two sides meet at different steepness, so the graph has a corner at (2,4)(2, 4), which is a different issue from a break.

Jump

Definition A piecewise function has a jump at a switching input cc when the left branch approaches one number LL and the right branch approaches a different number RR. The size of the jump is ∣R−L∣\lvert R - L \rvert. At a jump the graph breaks, and at most one of the two endpoint heights can be the actual value f(c)f(c).

In plain words The two pieces arrive at different heights, so the pencil has to lift and move up or down.

Example For f(x)=x2f(x) = x^2 when x<1x < 1 and f(x)=4−xf(x) = 4 - x when x≥1x \ge 1, the left branch approaches L=1L = 1 and the right branch approaches R=3R = 3. The jump has size ∣3−1∣=2\lvert 3 - 1 \rvert = 2. The graph shows a hollow dot at (1,1)(1, 1) and a filled dot at (1,3)(1, 3). In calculus this is exactly the situation where the two one-sided limits exist but differ, so the two-sided limit at 11 does not exist.

Check yourself

  1. Let p(x)=3−xp(x) = 3 - x when x≤−1x \le -1, p(x)=x2p(x) = x^2 when −1<x<2-1 < x < 2, and p(x)=5p(x) = 5 when x≥2x \ge 2. Find p(−1)p(-1), p(0)p(0), p(2)p(2) and p(3)p(3).
Show the answer

The input −1-1 meets x≤−1x \le -1, so p(−1)=3−(−1)=4p(-1) = 3 - (-1) = 4. The input 00 meets −1<x<2-1 < x < 2, so p(0)=0p(0) = 0. Both 22 and 33 meet x≥2x \ge 2, so p(2)=5p(2) = 5 and p(3)=5p(3) = 5.

  1. For the function pp in the first question, describe what happens at each switching input. Is there a jump, and which dots are filled?
Show the answer

At x=−1x = -1 the left formula gives 44 and the right formula approaches (−1)2=1(-1)^2 = 1. That is a jump of size 33, with a filled dot at (−1,4)(-1, 4) and a hollow dot at (−1,1)(-1, 1). At x=2x = 2 the middle formula approaches 22=42^2 = 4 and the right branch starts at 55. That is a jump of size 11, with a hollow dot at (2,4)(2, 4) and a filled dot at (2,5)(2, 5).

  1. Find the constant cc that makes the branch values match at x=2x = 2 for the function equal to cx+1cx + 1 when x<2x < 2 and to x2x^2 when x≥2x \ge 2.
Show the answer

The right branch gives 22=42^2 = 4 at x=2x = 2, and this is also the value of the function there. The left formula gives 2c+12c + 1 at x=2x = 2. Setting 2c+1=42c + 1 = 4 gives

c=32.c = \frac{3}{2}.

How this lesson connects