How to Solve Piecewise Functions?

How to Solve Piecewise Functions?

A piecewise function is a function defined by two or more separate rules (expressions), each applying to a specific part of the domain. The key is identifying which rule to use based on where the input value falls. Piecewise functions appear throughout Algebra 1 and calculus, and they are also used to model real-world situations like tax brackets and shipping costs. This guide explains how to evaluate and graph piecewise functions step by step.

Tutor-style math help

Solve Piecewise Functions: what to notice and how to work it

Functions skill
A function is a rule that gives each input exactly one output. Function notation, tables, graphs, and equations are different ways to show the same input-output relationship.

What to notice first

Ask what kind of input you are given. Sometimes you substitute a number, sometimes you read a graph, and sometimes you combine two rules.

Common student mistake

Do not read \(f(4)\) as multiplication. It means the output of f when the input is 4.

Key formulas and cues

\(f(a)\text{ means replace }x\text{ with }a\)
\((f\circ g)(x)=f(g(x))\)
\(f^{-1}(x)\text{ reverses }f(x)\)
inputsoutputs-102137

A reliable path

  1. Identify the inputFind the x-value, expression, or inner function being used.
  2. Apply the ruleSubstitute with parentheses so signs and powers stay clear.
  3. Interpret the outputState the value, point, interval, domain, range, or inverse relationship.

Worked examples

Evaluate a function

Example: \(f(x)=4x-3\), find \(f(2)\)
  1. Replace x with 2.
  2. Compute 4(2) – 3.
  3. Simplify.
Answer: \(5\)

Compose functions

Example: \(f(x)=x+1\), \(g(x)=2x\), find \(f(g(3))\)
  1. Find g(3) = 6.
  2. Use that as the input for f.
  3. f(6) = 7.
Answer: \(7\)
Try one before moving on
Try: If \(h(x)=2x^2\), find \(h(-3)\).
Answer: \(18\). Use parentheses: \(2(-3)^2=18\).
Next step: do the matching worksheet or quiz while the method is still fresh, then come back and explain the first step in your own words.

What Is a Piecewise Function?

A piecewise function is written using a brace notation that lists each rule alongside its domain condition. For example:

Original price was: $27.99.Current price is: $17.99.
f(x) = { \(\color{blue}{2x + 3}\),   if x < 0
        { 1,        if \(\color{blue}{x = 0}\)
        { \(\color{blue}{x^{2} - 1}\),  if x > 0

Each piece is a separate formula that applies only when x satisfies the stated condition. The function has one output for each input — you just have to find which piece applies.

How to Work with Piecewise Functions

Evaluating a Piecewise Function

To find f(a) for a specific value a, identify which condition a satisfies, then apply only that formula.

Quick example: For the function above, find f(−2).
−2 < 0, so use the first piece: \(\color{blue}{f(-2) = 2(-2) + 3}\) = −\(\color{blue}{4 + 3}\) = −1

Domain of Each Piece

Each piece is active only over its stated domain interval. The conditions must cover all x-values of interest and must not overlap (each x-value maps to exactly one output).

Graphing a Piecewise Function

Graph each piece over its own domain interval. Use open circles (∘) for strict inequalities (<, >) at the endpoints, and closed circles (•) for ≤ or ≥.

Step-by-Step Summary

  1. Identify the x-value (input) you are working with.
  2. Find which domain condition that x-value satisfies.
  3. Apply only that formula to compute the output.
  4. To graph: for each piece, identify the domain interval, evaluate key points, and draw that segment/curve with the correct open or closed endpoints.

Watch: Graphing Piecewise Functions (Video Lesson)

The Organic Chemistry Tutor covers piecewise functions including graphing, domain, range, and continuity:


Piecewise Functions – Worked Examples

Example 1: Evaluate f(x) at x = −2, −1, 0, 1, and 3 for:

f(x) = { \(\color{blue}{2x + 3}\),   if x < 0
        { 1,        if \(\color{blue}{x = 0}\)
        { \(\color{blue}{x^{2} - 1}\),  if x > 0

x = −2: x < 0 → \(\color{blue}{2(-2)+3}\) = −1 → f(−2) = −1
x = −1: x < 0 → \(\color{blue}{2(-1)+3 = 1}\) → f(−1) = 1
\(\color{blue}{x = 0}\): \(\color{blue}{x = 0}\) → f(0) = 1
\(\color{blue}{x = 1}\): x > 0 → 1²−\(\color{blue}{1 = 0}\) → f(1) = 0
\(\color{blue}{x = 3}\): x > 0 → 3²−\(\color{blue}{1 = 8}\) → f(3) = 8

Example 2: Evaluate g(x) at x = −3, −1, 0, and 2 for:

g(x) = { −\(\color{blue}{x + 2}\),  if x ≤ −1
        { \(\color{blue}{3x - 1}\),  if x > −1

x = −3: x ≤ −1 → −\(\color{blue}{(-3)+2 = 3+2 = 5}\) → g(−3) = 5
x = −1: x ≤ −1 → −\(\color{blue}{(-1)+2 = 1+2 = 3}\) → g(−1) = 3
\(\color{blue}{x = 0}\): x > −1 → \(\color{blue}{3(0)-1}\) = −1 → g(0) = −1
\(\color{blue}{x = 2}\): x > −1 → \(\color{blue}{3(2)-1 = 5}\) → g(2) = 5

Example 3: Describe how to graph g(x) from Example 2.

Piece 1: Graph y = −\(\color{blue}{x + 2}\) for x ≤ −1. Use a closed circle at (−1, 3).
Piece 2: Graph \(\color{blue}{y = 3x – 1}\) for x > −1. Use an open circle at (−1, −4).
Note: at x = −1 the function equals 3 (\(\color{blue}{\text{ not } -4}\)), so the graph has a jump there.

Example 4: A phone plan charges $0.05 per text for the first 100 texts and $0.02 per text for each additional text. Write a piecewise function C(t) for the total cost of t texts.

C(t) = { 0.05t,               if \(\color{blue}{0 \le t \le 100}\)
        { \(\color{blue}{5 + 0.02(t - 100)}\), if t > 100

At \(\color{blue}{t = 150}\): \(\color{blue}{C(150) = 5 + 0.02(50) = 5 + 1}\) = $6.00

More Practice: Graphing Piecewise Functions – 2 Methods (Video Lesson)

Mario’s Math Tutoring demonstrates two approaches to graphing piecewise functions with full explanations:


Exercises: Piecewise Functions

Use the following function for problems 1–4:

h(x) = { \(\color{blue}{x + 5}\),    if x < −2
        { −3,      \(\color{blue}{\text{ if } -2 \le x}\) < 1
        { \(\color{blue}{2x - 4}\),  if \(\color{blue}{x \ge 1}\)
  1. Find h(−5).
  2. Find h(0).
  3. Find h(1).
  4. Find h(4).
  5. Write a piecewise function for f(x) = |x|.
  6. A parking lot charges $3 for the first hour and $1.50 for each additional hour. Write a piecewise cost function C(h) for \(\color{blue}{h \ge 1}\) hours.

Answers

  1. x = −5 < −2: h(−5) = −\(\color{blue}{5 + 5}\) = 0
  2. \(\color{blue}{x = 0}\), which \(\color{blue}{\text{ satisfies } -2 \le 0}\) < 1: h(0) = −3
  3. \(\color{blue}{x = 1 \ge 1}\): \(\color{blue}{h(1) = 2(1) – 4}\) = −2
  4. \(\color{blue}{x = 4 \ge 1}\): \(\color{blue}{h(4) = 2(4) – 4}\) = 4
  5. f(x) = { x, if \(\color{blue}{x \ge 0}\); −x, if x < 0 }
  6. C(h) = { 3, if \(\color{blue}{h = 1}\); \(\color{blue}{3 + 1.5(h-1)}\), if h > 1 }
Original price was: $109.99.Current price is: $54.99.

Free Piecewise Function Worksheet

Ready to practice on your own? Download our free Piecewise Function worksheet below, work through each problem at your own pace, and then check your answers. If a few give you trouble, scroll back up to the worked examples and try again — steady practice is the surest way to master Piecewise Function before a quiz or test.

Download Piecewise Functions Worksheet

Frequently Asked Questions

How do I know which piece of a piecewise function to use?

Find the domain condition that the input value satisfies, then apply only that formula. For example, if the conditions are “x < 0” and “\(\color{blue}{x \ge 0}\)”, check whether your x-value is negative or non-negative and choose accordingly.

What is the difference between an open and a closed circle on a piecewise graph?

A closed circle (filled-in dot) means the endpoint is included in that piece — used with ≤ or ≥. An open circle (hollow dot) means the endpoint is excluded — used with < or >. At the boundary between two pieces, one circle is open and one is closed if the function is defined there.

Can a piecewise function be continuous?

Yes. A piecewise function is continuous at a boundary point if the two adjacent pieces produce the same output value at that point. If they produce different values, the function has a jump discontinuity at that point and the graph has a gap.

Related Topics

Related to This Article

What people say about "How to Solve Piecewise Functions? - Effortless Math"?

No one replied yet.

Leave a Reply

X
51% OFF

Limited time only!

Save Over 51%

Take It Now!

SAVE $55

It was $109.99 now it is $54.99

The Ultimate Algebra Bundle 2026: From Pre-Algebra to Algebra II