On this page
When you first encounter limits in calculus, plugging the x-value into the function often works perfectly. But piecewise functions break this pattern. Because the rule changes at the boundary, simply plugging in a number can lead you to the wrong answer.
What are the left hand and right hand limit of a piecewise function?
A piecewise function uses different formulas for different parts of its domain. The boundary where the rule changes is the most critical point. To understand the function's behaviour here, we look at the one-sided limits:
The left-hand limit (x → a⁻): What value does the function approach as you get closer to a from the left side (values less than a)?
The right-hand limit (x → a⁺): What value does the function approach as you get closer to a from the right side (values greater than a)?
For example, consider this function: f(x) = x² if x < 2 f(x) = 5 - x if x > 2 f(x) = 1 if x = 2
Here, the boundary is at x = 2. The left-hand limit requires us to use the piece defined for x < 2. The right-hand limit requires the piece for x > 2.
How do you find the limit of a piecewise function?
Finding the limit involves testing both sides independently. According to the OpenStax Calculus text/02%3A_Limits/2.02%3A_The_Limit_of_a_Function), a two-sided limit exists if and only if both the left and right limits exist and are equal.
Calculate the left-hand limit: Take the expression defined for x < a and evaluate its limit as x → a. In our example, as x → 2⁻, we use x². The limit is 2² = 4.
Calculate the right-hand limit: Take the expression defined for x > a and evaluate its limit as x → a. As x → 2⁺, we use 5 - x. The limit is 5 - 2 = 3.
Compare the two limits: If they match, that is your final limit. If they do not match, the two-sided limit Does Not Exist (DNE).
In our example, 4 does not equal 3. Therefore, the limit of f(x) as x → 2 does not exist. This creates a jump discontinuity. If you want to dive deeper into how jumps differ from holes, you can read our guide on removable and jump discontinuities: telling them apart.
Why does the limit exist even if the function is undefined?
A limit describes a destination, not an arrival. It asks where the function is heading, not where it actually lands.
This is a major stumbling block. Students often struggle to correctly evaluate left and right limits because they confuse the limit with the function's defined value.
In our example, f(2) = 1. The defined point sits far away from the curves. Neither the left limit (4) nor the right limit (3) cares about this point. Even if f(2) was completely undefined, the one-sided limits would remain exactly the same. This foundational idea traces back to the 19th century; you can learn more about its history in our post on Karl Weierstrass and the epsilon-delta definition of a limit.
If you are struggling to picture why f(a) does not affect the limit, the Fermi Concept Library has a dedicated lesson for every concept in mathematics to help you build a clear mental map.
Is an absolute value function a piecewise function?
Yes, and this is where many students lose marks on exams like the JEE. An expression like |x - 5| is actually a piecewise function in disguise. By definition, absolute value changes its behaviour based on whether the inside is positive or negative.
|x - 5| = x - 5 if x ≥ 5 |x - 5| = -(x - 5) if x < 5
If an exam asks for the limit of |x - 5| / (x - 5) as x → 5, you cannot just plug in 5, because you will get 0/0. Instead, break it into left and right limits:
Right limit (x → 5⁺): The top becomes (x - 5). The fraction simplifies to (x - 5) / (x - 5) = 1. The limit is 1.
Left limit (x → 5⁻): The top becomes -(x - 5). The fraction simplifies to -(x - 5) / (x - 5) = -1. The limit is -1.
Since 1 does not equal -1, the two-sided limit does not exist. Recognizing absolute value as a piecewise function is half the battle.
A worked example for your next exam
Let us apply this to a classic exam-style question.
Find the limit as x → 3 for the function g(x): g(x) = 2x + 1 if x ≤ 3 g(x) = x² - 2 if x > 3
Step 1: Left-hand limit For x → 3⁻, we use values slightly less than 3. The rule is 2x + 1. Limit = 2(3) + 1 = 7.
Step 2: Right-hand limit For x → 3⁺, we use values slightly greater than 3. The rule is x² - 2. Limit = 3² - 2 = 9 - 2 = 7.
Step 3: Compare and conclude The left limit is 7. The right limit is 7. Because they are equal, the two-sided limit exists and is exactly 7.
Notice that the left piece included "≤ 3". The "or equal to" part tells us that g(3) = 7, making the function continuous. But for the purpose of finding the limit, we only cared about the "< 3" part of the rule.
When limits involve tricky fractions, like 0/0 forms, you might need extra tools. Check out our guide on Guillaume de l'Hôpital, the 0/0 rule and the first calculus textbook for more advanced techniques. And for more practice problems with a step-by-step solver that explains the reasoning rather than just printing an answer, try the Fermi Problem Library.



