Graph each piece only where its condition allows it
Quick review (2 minutes)
Think of laying several sections of road on one map.
Draw each branch only on its assigned interval, using open dots for strict boundaries and closed dots for included ones.
Combine the pieces; domain is the input union and range is the union of reached output heights.
1. Mark every boundary input on one common x-axis.
2. Identify each formula's known shape and calculate at least two useful points, or include a turning point for a curve.
3. Keep only the portion satisfying that branch's condition.
4. Calculate the boundary height and make its dot open or closed according to that branch's inequality.
5. Combine all allowed portions without inventing connecting segments across jumps or gaps.
6. Check the vertical line test at every boundary, then collect the domain and range shadows.
Let f(x) = if x ≤ 1, f(x) = 3 if 1 < x ≤ 2, and f(x) = x if x > 2. Graph it, find f(1), f(1.5), f(2) and f(4), and state domain and range.
f(1) = 1.
f(1.5) = 3.
f(2) = 3.
f(4) = 4.
Domain: (−∞, ∞).
Range: [0, ∞).
Joining the endpoint (1, 1) to the hollow endpoint (1, 3) with a vertical segment. That segment would create many outputs for x = 1. A jump stays a jump; it is not filled in.
1. Mark every boundary input on one common x-axis.
2. Identify each formula's known shape and calculate at least two useful points, or include a turning point for a curve.
3. Keep only the portion satisfying that branch's condition.
4. Calculate the boundary height and make its dot open or closed according to that branch's inequality.
5. Combine all allowed portions without inventing connecting segments across jumps or gaps.
6. Check the vertical line test at every boundary, then collect the domain and range shadows.
Function
A rule assigning exactly one output to each allowed input. Different inputs may share an output.
Input
The value you choose or supply to a function before its rule calculates an output.
Output
The result a function produces from a chosen allowed input.
Formula
A mathematical recipe describing how quantities are related or how to calculate a result.
Domain
The set of all inputs allowed for a function, considering its arithmetic and any stated context or restrictions.
Range
The set of all outputs a function actually produces from its allowed inputs.
Set
A collection of distinct objects or values. Its members may be listed or described by a condition.
Coordinate
One number describing a point's position along an axis. In (x, y), x is horizontal and y is vertical.
Real number
A number with a position on the number line, including whole numbers, fractions, decimals and numbers such as .
Restriction
A condition limiting allowed inputs, from arithmetic, a stated rule, or a meaningful physical situation.
Undefined
Having no assigned value in the number system or function being used. Division by zero is undefined in real arithmetic.
Inequality
A comparison using <, >, ≤ or >=. It describes which amount is smaller or larger and whether equality is allowed.
Nonnegative
Greater than or equal to 0. It includes positive numbers and 0, but excludes negative numbers.
Positive
Strictly greater than 0. Zero is excluded.
Negative
Strictly less than 0. Negative numbers lie to the left of 0 on a number line.
Principal square root
The nonnegative square root chosen by the √ symbol. It is one value even when a squared equation has two solutions.
Number line
A straight line placing real numbers in order, with smaller numbers left and greater numbers right.
Interval
A set containing every real number between its limits, with endpoints included or excluded as specified. It may extend without bound.
Endpoint
A finite boundary value at an interval's end, included or excluded according to its bracket or parenthesis.
Unbounded
Having no finite limit in at least one direction. A set can be bounded on one side and unbounded on the other.
Graph
A picture of points representing input and output pairs, usually with inputs horizontal and outputs vertical.
x-axis
The horizontal axis measuring x-values, usually function inputs. Every point on it has y = 0.
Vertical line test
A graph represents a function if every vertical line meets at most one included point. Two crossings give one input two outputs.
Piecewise function
A function using different formulas on specified parts of its domain. Each allowed input must have exactly one output.
Piece
One formula together with the input condition telling you where it is used in a piecewise function.
Boundary
An input where an interval starts or ends, or where a piecewise condition changes. Check which condition includes it.
Substitution
Replacing every occurrence of a variable with one specified value, then following the formula's operations.
1 In plain words
Think of laying several sections of road on one map. Each section has its own shape and its own starting and stopping positions. To graph a piecewise function, draw the shape for one formula, then keep it only where its condition allows it. Put all the permitted sections on the same axes. A filled endpoint says the road includes that exact location. A hollow endpoint shows where the shape would go if extended, but that point is absent. At a boundary, a different section may include a point at a different height. Read the assigned height rather than connecting every nearby endpoint.
2 Picture it
Reminder
Reminder: Substitution, Equality at a boundary, Principal square root
- Substitution. If f(x) = on the selected branch, f(1) means replace x by 1 and compute = 1.
- Equality at a boundary. 1 < x ≤ 2 includes 2, while x > 2 does not.
- Principal square root. If y ≥ 0, is nonnegative and (− = y.
3 Why
Graphing the whole formula of every branch can give inputs several competing outputs. Restricting each shape to its branch condition preserves the function's assigned pairs. At a strict boundary, the limiting point can help show where the curve approaches, but it is not part of the graph. The vertical line test counts only included points, so open boundary circles do not create extra outputs. After drawing all pieces, take the union of their horizontal shadows for the domain and their vertical shadows for the range. Different branch ranges may overlap.
4 The rule
Draw each branch only on its assigned interval, using open dots for strict boundaries and closed dots for included ones.
Combine the pieces; domain is the input union and range is the union of reached output heights.
The same idea, five ways
Say keep the permitted piece and mark whether its endpoint belongs.
A piecewise graph consists of the formula's points only where its condition allows them.
- x ≤ 1: draw with a closed endpoint at (1, 1)
- 1 < x ≤ 2: draw 3 with open (1, 3), closed (2, 3)
- x > 2: draw x with open (2, 2)
- Whole domain: {x | x is real} = (−∞, ∞)
- Whole range: {y | y ≥ 0} = [0, ∞)
Cut unused road sections away before placing the remaining pieces on one map.
The same idea, other ways
Imagine drawing the full square curve, horizontal line and identity line on separate sheets. Cut away the inputs their conditions reject. Place the remaining pieces on one coordinate plane.
At x = 1 in the given function, (1, 1) belongs and (1, 3) does not. At x = 2, (2, 3) belongs and (2, 2) does not. The filled point gives the function value.
A filled endpoint is present, and a hollow endpoint is absent. A piecewise graph can show several endpoint markers at one input, but the vertical line test counts only the included points.
The given function's input pieces fill the whole real number line. Its square branch alone already reaches every nonnegative output. Other pieces can change which input gives a height without adding new heights to the range.
Part 1: Draw the quadratic branch
The first branch uses the familiar square curve. Its condition keeps all inputs at most 1, including negative inputs far to the left. That left arm keeps rising, so this one branch reaches output heights much larger than its right endpoint's height.
- Formula: for x ≤ 1.
- Closed endpoint: (1, 1).
- Included vertex: (0, 0).
- Branch domain: (−∞, 1]; branch range: [0, ∞).
Reminder
Reminder: Substitution, Equality at a boundary, Principal square root
- Substitution. If f(x) = on the selected branch, f(1) means replace x by 1 and compute = 1.
- Equality at a boundary. 1 < x ≤ 2 includes 2, while x > 2 does not.
- Principal square root. If y ≥ 0, is nonnegative and (− = y.
The same idea, five ways
Say keep the square curve through input one and all inputs to its left.
The quadratic branch includes its boundary and reaches every nonnegative height.
- f(x) = if x ≤ 1
- Branch domain: (−∞, 1]
- Branch range: [0, ∞)
- Graph words: closed (1, 1), vertex (0, 0), left arm continues
Cut away only the forbidden input side of a drawn square curve.
Worked example
Draw the first branch of the given function
Graph only the branch f(x) = for x ≤ 1.
Show the steps and the answer
- We need the included graph points, keeping only the assigned input interval.State what is being found before choosing the calculation.
- Mark the boundary and choose sample inputs , 0 and 1.All these inputs satisfy this branch's condition.
- Read the column under : . Under . Under 0, . Under 1, .Squaring each selected input supplies points on the quadratic shape.
- Draw the U-shaped curve through these points, keeping only .The formula is assigned to this interval alone.
- Place a closed dot at (1, 1) and extend the left side upward with an arrow.Equality includes x = 1, and there is no lower input bound.
- This branch has domain and range .The vertex reaches zero, and arbitrarily negative inputs have arbitrarily large squares.
- Plot (−2, 4), (−1, 1), (0, 0) and the closed point (1, 1).
- Keep the curve only for x ≤ 1.
- Branch domain: (−∞, 1].
- Branch range: [0, ∞).
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Use a negative sample input to remember the rising left arm.
Part 2: Draw the constant branch
The middle branch is a horizontal shelf at height 3. It begins after input 1 and includes input 2. Every position on that shelf has the same output. The endpoints have different inclusion rules even though the shelf is flat.
- Formula: 3 for 1 < x ≤ 2.
- Open endpoint: (1, 3); closed endpoint: (2, 3).
- Branch domain: (1, 2]; branch range: {3}.
Reminder
Reminder: Substitution, Equality at a boundary, Principal square root
- Substitution. If f(x) = on the selected branch, f(1) means replace x by 1 and compute = 1.
- Equality at a boundary. 1 < x ≤ 2 includes 2, while x > 2 does not.
- Principal square root. If y ≥ 0, is nonnegative and (− = y.
The same idea, five ways
Say a shelf after input one through input two.
The constant branch excludes its left boundary and includes its right boundary.
- f(x) = 3 if 1 < x ≤ 2
- Branch domain: (1, 2]
- Branch range: {3} = [3, 3]
- Graph words: open (1, 3), closed (2, 3)
A horizontal shelf keeps the same height across its allowed span.
Worked example
Draw the middle branch of the given function
Graph only f(x) = 3 for 1 < x ≤ 2.
Show the steps and the answer
- We need the included graph points, keeping only the assigned input interval.State what is being found before choosing the calculation.
- Mark the interval from 1 to 2.The condition restricts this branch to those input positions.
- Draw a horizontal segment at .The output stays 3 for every input in this interval.
- Use an open dot at (1, 3) and a closed dot at (2, 3).The left comparison is strict and the right comparison includes equality.
- The branch domain is (1, 2] and range is {3}.Many allowed inputs produce the single output 3.
- Draw a horizontal segment at height 3.
- Open point: (1, 3).
- Closed point: (2, 3).
- Branch domain: (1, 2].
- Branch range: {3}, also [3, 3].
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Mark each endpoint from its own comparison sign.
Part 3: Draw the identity branch
The last branch follows the slanted line where output equals input. It starts strictly after 2, so the point (2, 2) is hollow. The whole function still has a value at input 2 because the middle branch supplies it at height 3.
- Formula: x for x > 2.
- Open boundary point: (2, 2).
- Sample included points: (3, 3) and (4, 4).
- Branch domain and branch range: (2, ∞).
Open boundary: (2, 2)
Included points: (3, 3), (4, 4)
Continue upward and rightward
Reminder
Reminder: Substitution, Equality at a boundary, Principal square root
- Substitution. If f(x) = on the selected branch, f(1) means replace x by 1 and compute = 1.
- Equality at a boundary. 1 < x ≤ 2 includes 2, while x > 2 does not.
- Principal square root. If y ≥ 0, is nonnegative and (− = y.
The same idea, five ways
Say copy each input strictly above two.
The last branch is the identity line only to the right of its excluded boundary.
- f(x) = x if x > 2
- Branch domain and range: (2, ∞)
- Graph words: open (2, 2), ray through (3, 3) and (4, 4)
A diagonal path keeps the horizontal position and vertical height equal.
Open boundary: (2, 2)
Included points: (3, 3), (4, 4)
Continue upward and rightward
Worked example
Draw the final branch of the given function
Graph only f(x) = x for x > 2.
Show the steps and the answer
Open boundary: (2, 2)
Included points: (3, 3), (4, 4)
Continue upward and rightward
- We need the included graph points, keeping only the assigned input interval.State what is being found before choosing the calculation.
- Compute the boundary position (2, 2), but leave it open.The formula would give 2 there, but the condition excludes that input from this branch.
- Plot (3, 3) and (4, 4).Both inputs are above 2, and the identity rule keeps their values.
- Draw a straight ray through the included points and continue upward to the right.The identity graph is a line and has no upper input bound.
- Write for both this branch's domain and range.The included inputs and identical outputs are strictly greater than 2.
- Open point: (2, 2).
- Draw the ray through (3, 3) and (4, 4), continuing rightward.
- Branch domain: (2, ∞).
- Branch range: (2, ∞).
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- A branch exclusion does not remove an input assigned by another branch.
5 How
- Mark every boundary input on one common x-axis.
- Identify each formula's known shape and calculate at least two useful points, or include a turning point for a curve.
- Keep only the portion satisfying that branch's condition.
- Calculate the boundary height and make its dot open or closed according to that branch's inequality.
- Combine all allowed portions without inventing connecting segments across jumps or gaps.
- Check the vertical line test at every boundary, then collect the domain and range shadows.
Build a piecewise graph
- Mark every boundary input on one common x-axis.
- Identify each formula's known shape and calculate at least two useful points, or include a turning point for a curve.
- Keep only the portion satisfying that branch's condition.
- Calculate the boundary height and make its dot open or closed according to that branch's inequality.
- Combine all allowed portions without inventing connecting segments across jumps or gaps.
- Check the vertical line test at every boundary, then collect the domain and range shadows.
6 Worked example
Worked example
Graph and read all three pieces
Let f(x) = if x ≤ 1, f(x) = 3 if 1 < x ≤ 2, and f(x) = x if x > 2. Graph it, find f(1), f(1.5), f(2) and f(4), and state domain and range.
Show the steps and the answer
- We need every allowed input and every output the rule actually reaches.State what is being found before choosing the calculation.
- Draw only for , with a closed point at (1, 1).The first condition includes its boundary; the square curve has its lowest point at (0, 0).
- Draw on , with an open point at (1, 3) and a closed point at (2, 3).This condition excludes its left endpoint and includes its right endpoint.
- Draw only for x > 2, beginning with an open point at (2, 2).The third condition excludes 2, so its line does not assign an output there.
- At , choose the first branch and calculate .The ≤ 1 condition owns this boundary.
- At , choose the middle branch and get 3.1 < 1.5 ≤ 2.
- At , also choose the middle branch and get 3.The middle condition includes equality at 2; the final branch does not.
- At , choose the last branch and get 4.4 satisfies x > 2.
- Take the input union .Every real input belongs to one of these three intervals, with no gap.
- The first branch already reaches every , and neither other branch goes below zero.For any y ≥ 0 the allowed input − supplies that output through the first branch.
- Write range .Union with {3} and (2, ∞) adds no new values beyond the first branch's range.
- f(1) = 1.
- f(1.5) = 3.
- f(2) = 3.
- f(4) = 4.
- Domain: (−∞, ∞).
- Range: [0, ∞).
Ladder: from easy to exam-hard
Try each rung before you open its steps.
Rung 1 of 6
Graphing ladder 1: two pieces that meet
Graph F(x) = x for x < 0 and F(x) = 2x for x ≥ 0. State domain and range.
Show the steps and the answer
- We need every allowed input and every output the rule actually reaches.State what is being found before choosing the calculation.
- Draw the line only left of 0 with an open point at (0, 0).The first branch excludes its boundary and gives negative outputs for negative inputs.
- Draw the line on and right of 0 with a closed point at (0, 0), passing through (1, 2).The second branch includes the boundary and has twice the input as its output.
- Keep the included point at (0, 0) where the branches meet.An open marker from the first piece does not remove a point included by the second piece.
- Take the domain union .All negative and nonnegative inputs are covered.
- Take the range union .The first piece reaches every negative output; the second reaches every nonnegative output.
- Domain: (−∞, ∞).
- Range: (−∞, ∞).
- The graph has an included point at (0, 0).
Rung 2 of 6
Graphing ladder 2: a jump creates a missing output interval
Graph G(x) = x − 2 for x < 4 and G(x) = x + 3 for x ≥ 4. Find domain and range.
Show the steps and the answer
- We need every allowed input and every output the rule actually reaches.State what is being found before choosing the calculation.
- Draw left of 4, ending at the open point (4, 2).Inputs below 4 use the first branch. At 4 it would give 4 − 2 = 2, but 4 is not below 4, so that point is hollow and these outputs stay strictly below 2.
- Draw on and right of 4, starting at the closed point (4, 7) and passing through (5, 8).The second branch includes 4, where 4 + 3 = 7, and it produces outputs at least 7.
- The input intervals join to all real numbers.Every real input is either below 4 or at least 4.
- The output intervals remain and .No included point reaches a height from 2 up to but not including 7.
- Join the output intervals with .A union preserves the missing heights rather than filling them.
- Domain: (−∞, ∞).
- Range: (−∞, 2) ∪ [7, ∞).
- G(4) = 7.
Rung 3 of 6
Graph and read all three pieces
Let f(x) = if x ≤ 1, f(x) = 3 if 1 < x ≤ 2, and f(x) = x if x > 2. Graph it, find f(1), f(1.5), f(2) and f(4), and state domain and range.
Show the steps and the answer
- We need every allowed input and every output the rule actually reaches.State what is being found before choosing the calculation.
- Draw only for , with a closed point at (1, 1).The first condition includes its boundary; the square curve has its lowest point at (0, 0).
- Draw on , with an open point at (1, 3) and a closed point at (2, 3).This condition excludes its left endpoint and includes its right endpoint.
- Draw only for x > 2, beginning with an open point at (2, 2).The third condition excludes 2, so its line does not assign an output there.
- At , choose the first branch and calculate .The ≤ 1 condition owns this boundary.
- At , choose the middle branch and get 3.1 < 1.5 ≤ 2.
- At , also choose the middle branch and get 3.The middle condition includes equality at 2; the final branch does not.
- At , choose the last branch and get 4.4 satisfies x > 2.
- Take the input union .Every real input belongs to one of these three intervals, with no gap.
- The first branch already reaches every , and neither other branch goes below zero.For any y ≥ 0 the allowed input − supplies that output through the first branch.
- Write range .Union with {3} and (2, ∞) adds no new values beyond the first branch's range.
- f(1) = 1.
- f(1.5) = 3.
- f(2) = 3.
- f(4) = 4.
- Domain: (−∞, ∞).
- Range: [0, ∞).
Rung 4 of 6
Graphing ladder 4: missing inputs and missing outputs
Let H(x) = x if x < −1 and H(x) = x + 2 if x ≥ 2. Graph it and state its domain and range.
Show the steps and the answer
- We need every allowed input and every output the rule actually reaches.State what is being found before choosing the calculation.
- Draw for , ending with an open point at .The first branch excludes its right boundary and extends downward to the left.
- Leave all inputs from through values below 2 blank.Neither condition assigns an output to those inputs.
- Draw for , starting with a closed point at (2, 4) and passing through (3, 5).The second condition includes 2 and gives output 2 + 2 = 4 there.
- Write domain .These are exactly the two allowed input intervals.
- Write range .The first line reaches every height below −1; the second reaches every height at least 4.
- Domain: (−∞, −1) ∪ [2, ∞).
- Range: (−∞, −1) ∪ [4, ∞).
- H(0) is undefined.
Rung 5 of 6
Graph a constant and a square-root branch
Let Q(x) = 5 if x < −4 and Q(x) = if x ≥ −4. Graph the two assigned pieces and find domain and range. You are drawing each shape only for its own input condition, then collecting the whole graph’s two shadows.
Show the steps and the answer
- For , draw a horizontal ray at height 5, with an open point at and continuation to the left.The constant rule gives one height on its assigned inputs, and the strict condition excludes the boundary.
- For , draw the root curve beginning at the closed point . At it passes through (0, 2), and at it passes through (5, 3).Substitution gives = 0, = 2, and = 3. The second condition includes the starting input and its root is real for every assigned input.
- Take the input union .Every input below the boundary uses the constant, and every input at or above it uses the root, so none is missing.
- The constant branch gives {5}. The root branch gives , because any target comes from .The nonnegative root outputs are all attained by the constructed input.
- The full output union is .Output 5 already lies in the root range, so including the constant branch adds no new height.
- Domain: (−∞, ∞).
- Range: [0, ∞).
Rung 6 of 6
Three shapes with two omitted boundary inputs
Let P(x) = if x < −3, P(x) = −7 if −3 < x < 9, and P(x) = if x > 9. Graph the pieces and find domain and range. You are retaining the branch shapes only on the stated intervals, including any missing inputs or isolated output heights.
Show the steps and the answer
- Draw the cube curve only for . At its right boundary the formula would give , so place an open point at .The strict condition excludes −3. Every earlier input gives a cube below −27.
- Draw a horizontal segment at height only for , with both and open.Both comparisons are strict, although every interior input supplies the actual output −7.
- For x > 9, the root curve’s boundary location is (9, 2), because . Leave that point open, and draw the curve through (14, 3), continuing rightward.Only inputs above 9 belong to this branch; they make the root inside greater than 4, so their root outputs are strictly greater than 2.
- Keep both missing input values and write .No condition includes −3 or 9; each other real input belongs to exactly one branch.
- The cube branch reaches exactly : for any , the input is below and cubes to y. The middle branch reaches the single value .Cubing preserves input order, and the constant branch has only one output despite its many inputs.
- The root branch reaches : for any target y > 2, choose ; then .The target is positive, so its square exceeds 4 and the principal root returns y. This proves every claimed root height is attained.
- Combine the three output sets as .The isolated height −7 belongs. A one-member set can be written [−7, −7], and union must preserve all missing heights around it.
- Domain: (−∞, −3) ∪ (−3, 9) ∪ (9, ∞).
- Range: (−∞, −27) ∪ [−7, −7] ∪ (2, ∞).
- P(−3) and P(9) are undefined.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- List each branch's domain and range separately before taking the two unions.
- Count only filled points in a vertical line test at a boundary.
- Keep jumps and missing intervals visible. Do not draw extra connecting segments.
7 The trap
Joining the endpoint (1, 1) to the hollow endpoint (1, 3) with a vertical segment. That segment would create many outputs for x = 1. A jump stays a jump; it is not filled in.
Comes back in
Problems marked OpenStax come from Precalculus 2e by Jay Abramson, published by OpenStax, under the CC BY-NC-SA 4.0 licence. Access for free at https://openstax.org/books/precalculus-2e/pages/1-introduction-to-functions.