Continuity, Differentiability and Special Functions
Entry tests love functions with breaks and corners: piecewise definitions, modulus functions, the greatest integer function ⌊x⌋ and the fractional part {x}. This lesson shows how to test such functions for continuity and differentiability using one-sided limits and one-sided derivatives, and how L'Hôpital's rule settles 0/0 and ∞/∞ limits that factorising cannot. It builds on the limits and continuity lesson and goes one step further, to derivatives.
Asked in: ECAT, NUST NET, JEE Main, FSc and Class 11-12 boards
Continuity at a point and types of discontinuity
f is continuous at x = a when the left-hand limit, the right-hand limit and the value f(a) all exist and are equal. For a piecewise function, check the joining points; each formula is usually continuous on its own piece.
If both one-sided limits exist and are equal but differ from f(a) (or f(a) is undefined), the discontinuity is removable. If the one-sided limits are finite but different, it is a jump discontinuity. If a one-sided limit is infinite, it is an infinite discontinuity.
- Continuous at a: lim x→a⁻ f(x) = lim x→a⁺ f(x) = f(a)
- Removable: LHL = RHL ≠ f(a)
- Jump: LHL ≠ RHL (both finite)
Differentiability and one-sided derivatives
The left-hand derivative at a is the limit of [f(a − h) − f(a)]/(−h) and the right-hand derivative is the limit of [f(a + h) − f(a)]/h as h → 0⁺. f is differentiable at a when both exist, are finite and are equal.
Differentiability implies continuity, but not the other way round. A continuous function fails to be differentiable at a corner (different one-sided slopes, as |x| at 0) or at a vertical tangent (as ∛x at 0). A discontinuous function is never differentiable there.
For a piecewise function that is continuous at the joining point, you can compare the derivatives of the two formulas at that point to find LHD and RHD.
- LHD = lim h→0⁺ [f(a − h) − f(a)]/(−h)
- RHD = lim h→0⁺ [f(a + h) − f(a)]/h
- Differentiable ⇒ continuous; continuous does not imply differentiable
Modulus functions
|x − a| is continuous everywhere but has a corner at x = a, where LHD = −1 and RHD = +1. More generally |g(x)| can fail to be differentiable only where g(x) = 0.
At a simple zero of g (where g changes sign and g′ ≠ 0) |g| has a corner. At a repeated zero, such as (x − 2)², the function touches zero smoothly and |g| stays differentiable. So x|x|, |x|³ and |(x − 1)²| are all differentiable at their zeros.
- d/dx |x| = x/|x| = sgn x, for x ≠ 0
- |g(x)| is not differentiable at simple zeros of g
- x|x| and |x|³ are differentiable at 0
Greatest integer and fractional part functions
⌊x⌋ is the greatest integer less than or equal to x: ⌊2.7⌋ = 2, ⌊−2.3⌋ = −3. It is constant between integers and jumps by 1 at each integer, so it is discontinuous (and not differentiable) exactly at the integers. Just left of an integer n its value is n − 1; at n and just right of it the value is n.
The fractional part is {x} = x − ⌊x⌋, which lies in [0, 1) and has period 1: {2.7} = 0.7 and {−2.3} = 0.7. It is also discontinuous at every integer.
Useful facts: ⌊x⌋ + ⌊−x⌋ = 0 if x is an integer and −1 otherwise. ⌊g(x)⌋ can jump only where g(x) passes through an integer value. The signum function sgn x (−1, 0, 1 for negative, zero, positive x) has a jump at 0.
- x − 1 less than ⌊x⌋ ≤ x
- {x} = x − ⌊x⌋, 0 ≤ {x} less than 1
- ⌊x⌋ + ⌊−x⌋ = 0 (x an integer) or −1 (otherwise)
Making a piecewise function continuous and differentiable
When a function is defined by different formulas on either side of a point and has unknown constants, use two conditions. Continuity: the two formulas give the same value at the joining point. Differentiability: their derivatives are also equal there.
Always impose continuity first; equal slopes alone are not enough, because a function with a jump is not differentiable even if both pieces have the same slope.
- Continuity at a: f₁(a) = f₂(a)
- Differentiability at a: f₁(a) = f₂(a) and f₁′(a) = f₂′(a)
L'Hôpital's rule
If f(x)/g(x) gives 0/0 or ∞/∞ at x = a (or as x → ∞), then the limit equals the limit of f′(x)/g′(x), provided that limit exists. Differentiate the numerator and denominator separately; do not use the quotient rule.
Apply it again if the new quotient is still 0/0 or ∞/∞, but check the form before every use. Other indeterminate forms must be converted first: write 0 × ∞ as a quotient, combine ∞ − ∞ into one fraction, and for the forms 1 to the power ∞, 0⁰ and ∞⁰ take logarithms.
- lim f/g = lim f′/g′ for 0/0 or ∞/∞ forms
- 0 × ∞: write f × g = f ÷ (1/g)
- For y = f raised to the power g: find L = lim g ln f, then y → eᴸ
Solved examples
- Find the left-hand and right-hand limits of ⌊x⌋ at x = 2 and decide whether ⌊x⌋ is continuous there.
- Just left of 2, for example at 1.99, ⌊x⌋ = 1, so the left-hand limit is 1.
- At 2 and just right of it, ⌊x⌋ = 2, so the right-hand limit is 2 and f(2) = 2.
- The one-sided limits differ, so there is a jump discontinuity at x = 2. ⌊x⌋ is continuous from the right but not from the left.
Answer: LHL = 1, RHL = 2; ⌊x⌋ is discontinuous at x = 2 - Is f(x) = |x − 3| continuous and differentiable at x = 3?
- Both one-sided limits at 3 are 0 and f(3) = 0, so f is continuous at 3.
- For x greater than 3, f(x) = x − 3 with slope 1, so RHD = 1. For x less than 3, f(x) = 3 − x with slope −1, so LHD = −1.
- LHD ≠ RHD, so f is not differentiable at 3; the graph has a corner there.
Answer: Continuous but not differentiable at x = 3 - f(x) = ax² + 1 for x ≤ 1 and f(x) = 4x + b for x greater than 1. Find a and b so that f is differentiable at x = 1.
- Continuity at 1: a(1)² + 1 = 4(1) + b, so a + 1 = 4 + b.
- Equal slopes at 1: the derivative of ax² + 1 is 2ax, which is 2a at x = 1; the derivative of 4x + b is 4. So 2a = 4 and a = 2.
- Then 2 + 1 = 4 + b gives b = −1.
Answer: a = 2, b = −1 - Find the points where f(x) = |x² − 5x + 6| is not differentiable, and the one-sided derivatives at x = 2.
- x² − 5x + 6 = (x − 2)(x − 3) has simple zeros at x = 2 and x = 3, so |f| can have corners only there.
- The derivative of x² − 5x + 6 is 2x − 5, which is −1 at x = 2 and 1 at x = 3, not zero, so both are genuine corners.
- At x = 2: for x just less than 2 the quadratic is positive, so the slope is 2x − 5 = −1 (LHD = −1). Just right of 2 it is negative, so f = −(x² − 5x + 6) and RHD = +1.
Answer: Not differentiable at x = 2 and x = 3; at x = 2, LHD = −1 and RHD = 1 - Evaluate lim x→0 (x − sin x)/x³.
- At x = 0 this is 0/0, so apply L'Hôpital: lim (1 − cos x)/(3x²), still 0/0.
- Again: lim sin x/(6x), still 0/0.
- Again: lim cos x/6 = 1/6.
Answer: 1/6 - Evaluate lim x→0⁺ x ln x, and hence lim x→0⁺ xˣ.
- As x → 0⁺ this is 0 × (−∞). Rewrite it as ln x ÷ (1/x), which is −∞/∞.
- L'Hôpital: (1/x) ÷ (−1/x²) = −x, which tends to 0. So lim x ln x = 0.
- For y = xˣ, ln y = x ln x → 0, so y → e⁰ = 1.
Answer: lim x ln x = 0 and lim xˣ = 1
Exam shortcuts
- For ⌊x⌋ at an integer n, the left-hand limit is n − 1 and the right-hand limit is n. Write them down before doing anything else.
- To find where |g(x)| is not differentiable, list the simple zeros of g; ignore repeated zeros such as those of (x − 2)².
- A function that is not continuous at a point cannot be differentiable there, so check continuity first and stop if it fails.
- In L'Hôpital questions, check the form at every step; once the limit is no longer 0/0 or ∞/∞, substitute instead of differentiating again.
- For ⌊g(x)⌋ on an interval, count the integer values that g passes through inside the interval; each one is a point of discontinuity (when g is increasing or decreasing there).
Common mistakes
- Using the quotient rule in L'Hôpital's rule; the numerator and denominator are differentiated separately.
- Applying L'Hôpital's rule to a limit that is not 0/0 or ∞/∞, such as (x + 1)/(x + 2) at x = 0, which gives a wrong answer.
- Writing ⌊−2.3⌋ = −2 or {−2.3} = −0.3; the correct values are −3 and 0.7.
- Matching only the slopes of a piecewise function and forgetting to check that the two pieces meet at the same value.
- Assuming |g(x)| has a corner at every zero of g; repeated zeros give smooth points.
Practice MCQs
- What is lim x→3⁻ ⌊x⌋?
A) 1
B) 2
C) Does not exist
D) 3
Answer: B) 2 — Just to the left of 3, for example at 2.99, ⌊x⌋ = 2, so the left-hand limit is 2. 3 is the right-hand limit (and the value at 3). The two-sided limit does not exist, but the question asks only for the left-hand limit, which does exist. 1 drops one integer too many. - At which points is f(x) = ⌊x⌋ discontinuous?
A) At every real number
B) Only at x = 0
C) At no point
D) At every integer
Answer: D) At every integer — ⌊x⌋ is constant between consecutive integers and jumps by 1 at each integer, so it is discontinuous exactly at the integers. It is not special at 0 alone, it is clearly not continuous everywhere, and between integers (for example at 2.5) it is continuous. - What is the fractional part {−2.3}, where {x} = x − ⌊x⌋?
A) 0.7
B) −0.7
C) −0.3
D) 0.3
Answer: A) 0.7 — ⌊−2.3⌋ = −3, so {−2.3} = −2.3 − (−3) = 0.7. 0.3 and −0.3 come from taking ⌊−2.3⌋ = −2, and negative answers are impossible because the fractional part always lies in [0, 1). - The function f(x) = |x| at x = 0 is:
A) differentiable but not continuous
B) both continuous and differentiable
C) continuous but not differentiable
D) neither continuous nor differentiable
Answer: C) continuous but not differentiable — Both one-sided limits and f(0) are 0, so |x| is continuous at 0. The left slope is −1 and the right slope is +1, so it is not differentiable. 'Differentiable but not continuous' can never happen, and the other two choices contradict one of these checks. - For f(x) = |2x − 3|, the left-hand and right-hand derivatives at x = 3/2 are:
A) 0 and 0
B) −2 and 2
C) 2 and −2
D) −1 and 1
Answer: B) −2 and 2 — Left of 3/2, f(x) = 3 − 2x with slope −2; right of 3/2, f(x) = 2x − 3 with slope 2. So LHD = −2 and RHD = 2. ±1 ignores the factor 2 inside, 2 and −2 has the sides reversed, and 0 and 0 confuses the value f(3/2) = 0 with the slopes. - Which of these functions is differentiable at x = 0?
A) |sin x|
B) ∛x
C) x|x|
D) |x|
Answer: C) x|x| — x|x| equals x² for x ≥ 0 and −x² for x less than 0; both pieces have slope 0 at 0, so it is differentiable with derivative 0. |x| and |sin x| have corners (slopes −1 and 1), and ∛x has a vertical tangent at 0, so its derivative is infinite. - Using L'Hôpital's rule, lim x→0 (eˣ − 1 − x)/x² equals:
A) 1/2
B) 2
C) 1
D) 0
Answer: A) 1/2 — 0/0, so differentiate: (eˣ − 1)/(2x), still 0/0; again: eˣ/2 → 1/2. 1 forgets the 2 from differentiating x², 0 stops after one step and substitutes into a 0/0 form, and 2 inverts the final fraction. - lim x→0 (tan x − x)/x³ equals:
A) 1/6
B) 1/3
C) 1
D) 2/3
Answer: B) 1/3 — L'Hôpital gives (sec²x − 1)/(3x²) = tan²x/(3x²), and since tan x/x → 1, the limit is 1/3. 1/6 is the answer for (x − sin x)/x³, 2/3 doubles the result by differentiating tan²x wrongly, and 1 ignores the factor 3. - lim x→∞ x²/eˣ equals:
A) ∞
B) 0
C) 1
D) 2
Answer: B) 0 — ∞/∞, so apply L'Hôpital twice: 2x/eˣ, then 2/eˣ, which tends to 0. Exponentials grow faster than any power. ∞ assumes the numerator wins, 1 treats both as growing equally, and 2 stops at the numerator of 2/eˣ without letting the denominator grow. - At how many points is f(x) = |x − 1| + |x − 2| + |x − 3| not differentiable?
A) 1
B) 2
C) 0
D) 3
Answer: D) 3 — Each term has a corner at its own zero, x = 1, 2 or 3, and at each of these points the other two terms are smooth, so the slope jumps by 2 there. That gives 3 points. 1 counts only the middle point (where f is smallest), 2 counts only the end points, and 0 forgets that a sum of smooth terms and one corner still has a corner. - What is lim x→1 (⌊x⌋ + ⌊−x⌋)?
A) 1
B) 0
C) Does not exist
D) −1
Answer: D) −1 — For non-integer x, ⌊x⌋ + ⌊−x⌋ = −1. Near x = 1 (on both sides) x is not an integer, so both one-sided limits are −1 and the limit is −1. 0 is the value at x = 1 itself, which does not affect the limit, so the function has a removable discontinuity there. 1 and 'does not exist' come from mixing up the one-sided values of ⌊x⌋ and ⌊−x⌋. - f(x) = x³ for x ≤ 1 and f(x) = ax + b for x greater than 1. For f to be differentiable at x = 1, (a, b) must be:
A) (3, 2)
B) (−2, 3)
C) (3, −2)
D) (1, 0)
Answer: C) (3, −2) — Equal slopes: 3x² = 3 at x = 1, so a = 3. Continuity: 1 = a + b, so b = −2. (3, 2) has the right slope but jumps from 1 to 5, (1, 0) is continuous (1 = 1) but has slope 1 instead of 3, and (−2, 3) swaps the two values. - Where is f(x) = |(x − 1)(x − 2)²| not differentiable?
A) At x = 1 and x = 2
B) At x = 2 only
C) At x = 1 only
D) Nowhere
Answer: C) At x = 1 only — f = (x − 2)²|x − 1|. At x = 1, (x − 2)² = 1 and |x − 1| has a corner, so the one-sided slopes are −1 and 1. At x = 2 the repeated factor makes both one-sided slopes 0, so f is differentiable there. Choosing x = 2 or both points forgets that repeated zeros give smooth points, and 'nowhere' misses the corner at 1. - lim x→0 (cosec²x − 1/x²) equals:
A) 1/3
B) 2/3
C) 0
D) −1/3
Answer: A) 1/3 — Combine: (x² − sin²x)/(x² sin²x). Since sin x ≈ x − x³/6, sin²x ≈ x² − x⁴/3, so the numerator ≈ x⁴/3 and the denominator ≈ x⁴, giving 1/3 (repeated L'Hôpital gives the same). 0 assumes the two terms cancel, 2/3 doubles the x⁴ coefficient, and −1/3 is the limit of 1/x² − cosec²x, with the order reversed. - How many points of discontinuity does f(x) = ⌊x²⌋ have in the open interval (0, 3)?
A) 8
B) 2
C) 3
D) 9
Answer: A) 8 — On (0, 3), x² increases from 0 to 9, so ⌊x²⌋ jumps whenever x² passes an integer 1, 2, …, 8, that is at x = 1, √2, √3, 2, √5, √6, √7, 2√2: 8 points. 2 counts only the integer values of x, 9 includes x² = 9 (x = 3), which is outside the open interval, and 3 counts x = 0, 1, 2.
Questions
Can a function be continuous at a point but not differentiable there?
Yes. |x| at 0 is the standard example: there is no break, but the graph has a corner, so the left and right slopes differ. The reverse is impossible: every differentiable function is continuous.
Is ⌊x⌋ continuous from the right at integers?
Yes. At an integer n, ⌊n⌋ = n and the right-hand limit is also n, so ⌊x⌋ is right-continuous everywhere. Only the left-hand limit, n − 1, fails to match.
When is L'Hôpital's rule not allowed?
When the limit is not of the form 0/0 or ∞/∞. If substitution already gives a number, or a form like 1/0, the rule does not apply and using it gives a wrong answer.
Is L'Hôpital's rule accepted in board exams?
It is part of many syllabuses and widely used in entry tests. In a board exam where the chapter asks for factorisation or standard limits, use those methods, and use L'Hôpital to check your answer.