On this page
A function comes in two pieces, one contains k, and you must find the k that makes it continuous. Most versions of this question, from Class 12 boards to JEE Main, come down to one rule at the point where the pieces meet.
What does continuous at a point mean?
NCERT's Class 12 Mathematics, Chapter 5 says a function is continuous at x = c if the left hand limit, the right hand limit and the value of the function at x = c exist and are equal to each other.
OpenStax Calculus Volume 1 splits the same idea into three checks: f(a) is defined, the limit as x approaches a exists, and that limit equals f(a).
Each piece on its own is usually already continuous, so the joining point is the only place you need to work.
How do you find k so that a piecewise function is continuous?
Find the joining point c, where the rule changes.
Left-hand limit: put x = c into the piece used for x just below c.
Right-hand limit: put x = c into the piece used for x just above c.
Value f(c): read it from whichever piece carries the equals sign, or from a separate line such as "k, if x = c".
Set the expressions equal and solve for k.
Check: substitute your k back and confirm all three numbers match.
Take Exercise 5.1, Question 29 from the NCERT chapter: f(x) = kx + 1 if x ≤ 5, and f(x) = 3x − 5 if x > 5.
Left-hand limit and f(5), both from the first piece: 5k + 1.
Right-hand limit, from the second piece: 3(5) − 5 = 10.
Equate: 5k + 1 = 10, so k = 9/5.
Check: 5(9/5) + 1 = 9 + 1 = 10. All three agree.
What if there are two unknowns, like a and b?
Write one equation for each joining point.
Question 30 of the same NCERT exercise defines f(x) = 5 if x ≤ 2, ax + b if 2 < x < 10, and 21 if x ≥ 10.
At x = 2: the middle piece must reach 5, so 2a + b = 5.
At x = 10: the middle piece must reach 21, so 10a + b = 21.
Subtract the first equation from the second: 8a = 16, so a = 2 and b = 1.
Check: 2x + 1 gives 5 at x = 2 and 21 at x = 10.
With only one joining point you get one equation, so the answer is a relationship. In Question 17, ax + 1 for x ≤ 3 and bx + 3 for x > 3 give 3a + 1 = 3b + 3, so a − b = 2/3.
When do you need to factor and cancel?
Say f(x) = (x² − 5x + 6)/(x − 2) for x ≠ 2, and f(2) = k.
Putting x = 2 into the top and bottom gives 0/0. That is not a value. It tells you the top and bottom share a factor of (x − 2).
OpenStax's guide to limit laws gives the rule for this case: when numerator and denominator are polynomials, factor each one and cancel common factors.
Factor: x² − 5x + 6 = (x − 2)(x − 3).
For x ≠ 2, cancel: f(x) = x − 3.
Limit as x approaches 2: 2 − 3 = −1.
So k = −1.
Cancelling is allowed because a limit looks at x near 2, never at x = 2 itself. Trigonometric versions, such as NCERT's Question 26, need the standard limits in our guide to limits and continuity for JEE.
Which mistakes cost marks most often?
Using the x > c piece for the left-hand limit. Mark the side next to each piece before substituting.
Forgetting f(c) when it sits on its own line. In NCERT's Example 4 in the same chapter, the limit as x approaches 0 is 3 but f(0) = 1, so the function is not continuous there.
Writing k from a 0/0 form without simplifying.
Skipping the final check, which catches sign slips.
Once k is fixed, the next question is often whether the function is also smooth there; see differentiability with corners and piecewise functions. To name the break you are fixing, read removable and jump discontinuities.
If your k keeps disagreeing with the answer key, the Fermi Problem Library has a step-by-step solver that explains the reasoning rather than printing an answer, so you can see which step went wrong.
For practice, work through Questions 26 to 30 of NCERT Exercise 5.1 with the six steps above.



