Piecewise Functions

A piecewise defined function is a function defined by at least two equations (“pieces”), each of which applies to a different part of the domain. Piecewise defined functions can take on a variety of forms. Their “pieces” may be all linear, or a combination of functional forms (such as constant, linear, quadratic, cubic, square root, cube root, exponential, etc.). Due to this diversity, there is no “parent function” for piecewise defined functions.

Sometimes a function is defined by different formulas on different parts of its domain. A function with this property is
known as a piecewise-defined function. The absolute value function is an example of a piecewise-defined function
because the formula changes with the sign of x:

f(x)={x,x<0x,x0f\left( x \right) =\begin{cases} -x,& x<0\\ x,& x\ge 0\\ \end{cases}

Other piecewise-defined functions may be represented by completely different formulas, depending on the part of the
domain in which a point falls. To graph a piecewise-defined function, we graph each part of the function in its respective domain, on the same coordinate system. If the formula for a function is different for x < a and x > a, we need to pay special attention to what happens at x = a when we graph the function. Sometimes the graph needs to include an open or closed circle to indicate the value of the function at x = a.

How to Evaluate Piecewise Functions

To find the value of a piecewise function for a specific number.

  1. Look at the input number (x).
  2. Check which domain restriction or condition that number satisfies.
  3. Plug that number only into the specific rule assigned to that interval.

How to Graph Piecewise Functions

To draw the graph of a piecewise function.

  1. Lightly sketch each individual equation across the entire coordinate plane.
  2. Erase or keep only the parts of each line or curve that fit the specific x-value rules (domain restrictions).
  3. Use a solid dot (•) at boundary points where the endpoint is included (≤ or ≥).
  4. Use an open circle (◦) at boundary points where the endpoint is not included (< or >).

Graph the linear function y=x+3 on the interval (−∞,1) and graph the quadratic function y=(x2)2 on the interval [1,). Since the value of the function at x=1 is given by the formula f(x)=(x2)2, we see that f(1)=1. To indicate this on the graph, we draw a closed circle at the point (1,1). The value of the function is given by f(x)=x+3 for all x<1, but not at x=1. To indicate this on the graph, we draw an open circle at (1,4).

f(x)={x+3x<1(x2)2x1f\left( x \right) =\begin{cases} x+3& x<1\\ \left( x-2 \right) ^2& x\ge 1\\ \end{cases}

 

Figure 1.22 This piecewise-defined function is linear for x < 1 and quadratic for x ≥ 1
Calculus Volume 1 (openstax)

Limits and Continuity of a Piecewise Function

A piecewise function uses different formulas for different parts of its domain. Limits test what value a function approaches near a specific point. At the boundary where a function changes its formula, you must use one-sided limits to see if the left and right pieces meet. If both sides approach the same value, the general limit exists.

Finding Limits at Boundary Points

  • Check left-side limit: Plug values approaching the boundary from the smaller side into that specific piece’s formula.
  • Check right-side limit: Plug values approaching the boundary from the larger side into that specific piece’s formula.
  • Compare values: If the left limit equals the right limit, the overall limit exists and equals that value. If they differ, the limit does not exist (a jump happens).

Testing for Continuity

  • Match the limit to the point: A piecewise function is continuous at a boundary point only if the general limit equals the actual function value f(c) defined at that point.
  • Identify breaks: If the pieces do not connect, the function has a jump or removable discontinuity.

A general limit is the value that a function’s output approaches as the input gets closer and closer to a specific number. Written as shown below, it describes where the graph is heading, even if the function is not actually defined at that exact point.

limxaf(x)=L\lim_{x \to a} f(x) = L

Common Real-World Applications

Piecewise functions are used to model real-world situations where rules, rates, or behaviors change abruptly at specific threshold values. They combine multiple sub-functions across different intervals of a domain.

  • Taxes: Income up to a certain amount is taxed at one rate, and income above that amount is taxed at a higher rate.
  • Shipping and Postage: Delivery services and the U.S. Postal Service charge distinct price steps based on weight or size thresholds. Shipping might cost a flat fee for the first 5 pounds, and an extra fee per pound for anything heavier.
  • Utility Bills: Electricity, gas, and water companies often charge a lower or higher unit rate after a household crosses a specific consumption limit (tiered pricing).
  • Timed or Metered Services: Parking garages, taxi fares, and phone plans charge specific base rates or changing per-minute/per-hour rates depending on the duration of the service.
  • Physics and Motion: Tracking an object’s movement as it speeds up, travels at a constant velocity, and then slows down uses different linear equations for each time interval.

References

[ ] “Piecewise, Absolute Value and Step Functions.” MathBitsNotebook, Accessed August 14, 2026. https://mathbitsnotebook.com/Algebra1/FunctionGraphs/FNGTypePiecewise.html.

[ ] Strang, Gilbert and Edwin “Jed” Herman. “Calculus Volume 1.” 1.2 Basic Classes of Functions, Piecewise-Defined Functions. openstax, March 10, 2016. https://openstax.org/details/books/calculus-volume-1.

“Piecewise Functions: Got an Example of a Real World Piecewise Function?” Mathematics Stack Exchange, Accessed August 15, 2026. https://math.stackexchange.com/questions/154217/piecewise-functions-got-an-example-of-a-real-world-piecewise-function.

Goodman, Amy Graham. “Section 1.2:  Piecewise Defined Functions.” Baylor University’s Co-Requisite Supplement for Calculus I, July 1, 2023. https://openbooks.library.baylor.edu/mth1121/chapter/section-1-2-piecewise-defined-functions/.

“Introduction to Piecewise Functions.” Khan Academy, March 6, 2015. https://www.khanacademy.org/math/algebra/x2f8bb11595b61c86:absolute-value-piecewise-functions/x2f8bb11595b61c86:piecewise-functions/v/piecewise-function-example.

Sakr, Sherif. “Applications of the Piecewise-Defined Functions in Real-Life Situations.” LinkedIn, August 8, 2024. https://www.linkedin.com/pulse/applications-piecewise-defined-functions-real-life-situations-sakr-m6kyf.

“What is a real life example of a piecewise function?” Quora, Accessed August 15, 2026. https://www.quora.com/What-is-a-real-life-example-of-a-piecewise-function.

“2.4: Function Compilations – Piecewise, Combinations, and Composition.” LibreTexts, January 24, 2020. https://math.libretexts.org/Courses/Monroe_Community_College/MTH_165_College_Algebra_MTH_175_Precalculus/02%3A_Functions_and_Their_Graphs/2.04%3A_Function_Compilations_-_Piecewise_Algebraic_Combinations_and_Composition.

Pierce, Rod. “Piecewise Functions.” Math Is Fun, Accessed August 15, 2026. https://www.mathsisfun.com/sets/functions-piecewise.html.

Additional Reading

“Continuous Functions & Continuity.” Mathematical Mysteries, July 7, 2023. https://mathematicalmysteries.org/continuous-functions-continuity/.

“Differentiable.” Mathematical Mysteries, June 30, 2026. https://mathematicalmysteries.org/differentiable/.

“Limits.” Mathematical Mysteries, December 21, 2021. https://mathematicalmysteries.org/limits/.

“Limits and Continuity.” Khan Academy, Accessed August 15, 2026. https://www.khanacademy.org/math/ap-calculus-ab/ab-limits-new.

“Determining Limits of Piecewise Functions (Video).” Khan Academy, May 6, 2018. https://www.khanacademy.org/math/ap-calculus-ab/ab-limits-new/ab-1-5b/v/limits-of-piecewise-functions.

“Limits of Piecewise Functions.” MATHguide, Accessed August 15, 2026. https://www.mathguide.com/lessons3/Limits3.html.

[ ] McLogan, Brian. “Limits of Piecewise Functions.” YouTube. Accessed August 15, 2026. https://www.youtube.com/playlist?list=PL0G-Nd0V5ZMowAV5Q3TolqfIWng2E6qkn.

Learn how to evaluate the limit of a piecewice function. A piecewise function is a function that has different rules for a different range of values. The limit of a function as the input variable of the function tends to a number/value is the number/value which the function approaches at that time.

The limit of a function is usually evaluated by direct substitution of the value which the variable tends to. When the function is a piecewise function, then we test for the two criteria of a function. We test the function when the variable approaches from the negative (this is usually the rule that goes with the “less than” or the “less than and equal to” signs as the case may be). We test the function when the variable approaches from the positive (this is usually the rule that goes with the “greater than” or the “greater than and equal to” signs as the case may be). If these two conditions yield the same value, we then say that the function has a limit equal to that value. Otherwise, the limit does not exist.

Videos

 

 

 

 

What is a piecewise function? Piecewise functions are very cool, and give use a whole new world of functions to investigate and imagine! One of these functions is the absolute value function, which you may very well be familiar with!

Just like the name sounds, a piecewise function is a function that is defined in pieces. There are different rules for different parts of the function’s domain. We go over examples, piecewise function notation, and how to graph a piecewise function in this full video math lesson on piecewise functions!

 

 

 

 

 

In this video, we practice determining continuity in piecewise functions. You’ll learn how to check limits from the left and right, evaluate function values at breakpoints, and solve for constants to make piecewise functions continuous.


[ ] This exceptional reference is highly recommended for your consideration.

The featured image on this page is from the Worksheets HQ website.

Powered by WordPress.com.

Up ↑