Graphing Piecewise Functions

This tutorial explains how to graph piecewise functions step by step. We examine their graphs, domains, ranges, and key properties. You may also use free graph paper to sketch the graphs by hand.

Definition of a Piecewise Function

A piecewise function is a function defined by different formulas on different intervals of its domain.

Examples & Step-by-Step Solutions

Example 1: Basic Linear Piecewise Function

Problem: Graph and analyze the piecewise function:

\[ f(x) = \begin{cases} -x, & x \le 2 \\ x, & x > 2 \end{cases} \]

Solution:

Example 2: Piecewise Constant Function

Problem: Analyze the piecewise constant function:

\[ f(x) = \begin{cases} 2, & x > -3 \\ -5, & x < -3 \end{cases} \]

Solution:

Example 3: Absolute Value as a Piecewise Function \( f(x) = |x| \)

Problem: Rewrite and graph \( f(x) = |x| \) as a piecewise function.


Solution:

Using the definition of absolute value:

\[ f(x) = \begin{cases} x, & x \ge 0 \\ -x, & x < 0 \end{cases} \]
Example 4: Shifted Absolute Value Function \( f(x) = |x + 6| \)

Problem: Express \( f(x) = |x + 6| \) as a piecewise function and sketch.


Solution:

\[ f(x) = \begin{cases} x + 6, & x \ge -6 \\ -(x + 6), & x < -6 \end{cases} \]
Example 5: Multi-Interval Piecewise Function with Gaps

Problem: Analyze the function:

\[ f(x) = \begin{cases} x^2 - 3, & x \le -10 \\ -2x + 1, & -10 < x \le -2 \\ -x^3, & 2 < x < 4 \\ \ln x, & x > 4 \end{cases} \]

Solution:

Example 6: Step Function \( f(x) = \begin{cases} -1, & x \le -2 \\ 2, & x > -2 \end{cases} \)

Problem: Find the domain and range, and sketch the graph of:

\[ f(x) = \begin{cases} -1, & x \le -2 \\ 2, & x > -2 \end{cases} \]

Solution:

Graph of piecewise function in Example 6

Example 7: Quadratic & Linear Combination \( f(x) = \begin{cases} x^2 + 1, & x < 2 \\ -x + 3, & x \ge 2 \end{cases} \)

Problem: Find the domain, range, and sketch the graph of:

\[ f(x) = \begin{cases} x^2 + 1, & x < 2 \\ -x + 3, & x \ge 2 \end{cases} \]

Solution:

Graph of piecewise function in Example 7

Example 8: Rational & Exponential Piecewise Function \( f(x) = \begin{cases} \frac{1}{x}, & x < 0 \\ e^{-x}, & x \ge 0 \end{cases} \)

Problem: Graph and analyze:

\[ f(x) = \begin{cases} \frac{1}{x}, & x < 0 \\ e^{-x}, & x \ge 0 \end{cases} \]

Solution:

Graph of piecewise function in Example 8

Example 9: Multi-Part Piecewise Function \( f(x) = \begin{cases} -1, & x \le -1 \\ 1, & -1 < x \le 1 \\ x, & x > 1 \end{cases} \)

Problem: Find domain, range, and graph:

\[ f(x) = \begin{cases} -1, & x \le -1 \\ 1, & -1 < x \le 1 \\ x, & x > 1 \end{cases} \]

Solution:

Graph of piecewise function in Example 9

More References and Links

Explore additional graphing tutorials and resources:

Graphing Functions | Home Page