Class 12 Maths, Worked in Full Past papersGet updates
Chapter 5 · Continuity and Differentiability

Example 13: xx for x≥0x\ge0⁠, x2x^2 for x<0x<0⁠: continuous everywhere

ExamplesContinuity of piecewise functions · Section 5.2
The question

Discuss the continuity of the function ff given by

f(x)={x,if x≥0x2,if x<0f(x) = \begin{cases} x, & \text{if } x \ge 0 \\ x^2, & \text{if } x < 0 \end{cases}
Exam answer

For x<0x < 0⁠, f(x)=x2f(x) = x^2⁠, a polynomial. So ff is continuous at every c<0c < 0⁠.

For x>0x > 0⁠, f(x)=xf(x) = x⁠, a polynomial. So ff is continuous at every c>0c > 0⁠.

At x=0x = 0⁠: f(0)=0f(0) = 0 and

LHL=lim⁡x→0−x2=0,RHL=lim⁡x→0+x=0\begin{aligned} \text{LHL} &= \lim_{x\to 0^-} x^2 = 0, \\ \text{RHL} &= \lim_{x\to 0^+} x = 0 \end{aligned}

Since LHL=RHL=f(0)\text{LHL} = \text{RHL} = f(0)⁠, ff is continuous at x=0x = 0⁠.

∴ f\therefore\ f is continuous at every real number, so ff is a continuous function.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Split the real line at the junction 0 into three disjoint parts: x<0x < 0⁠, x=0x = 0⁠, x>0x > 0⁠. On the two open parts ff is a polynomial (x2x^2 or xx⁠), and polynomials are continuous. At the junction both pieces arrive at the same height, 0, and that is also the value f(0)f(0)⁠. Three equal numbers: continuous at 0 too, so ff is continuous everywhere.

Given, to find, and the plan
Given
f(x)=xf(x) = x for x≥0x \ge 0 and f(x)=x2f(x) = x^2 for x<0x < 0⁠.
To find
Where ff is continuous, and whether ff is a continuous function.
Plan
Domain first. Then the book's partition D1={x<0}D_1 = \{x < 0\}⁠, D2={0}D_2 = \{0\}⁠, D3={x>0}D_3 = \{x > 0\}⁠: continuity on D1D_1 and D3D_3 from the piece formulas, then the left-hand limit, right-hand limit and value at 0, each on its own line.

Basics you need

1Which line gives f(0)f(0)⁠?

"x≥0x \ge 0" means "x>0x > 0 or x=0x = 0", so 0 uses the first line: f(0)=0f(0) = 0⁠. The second line is only for x<0x < 0⁠. Basics: piecewise functions

2Limits of xx and x2x^2

lim⁡x→cx=c\lim_{x\to c} x = c (Example 6) and lim⁡x→cx2=c2\lim_{x\to c} x^2 = c^2 (product rule of limits: lim⁡x⋅lim⁡x=c⋅c\lim x \cdot \lim x = c \cdot c⁠), from either side. Basics: what a limit is

3One-sided limits

At the junction, the left-hand limit uses only x<0x < 0 (rule x2x^2⁠) and the right-hand limit uses only x>0x > 0 (rule xx⁠). Basics: left-hand and right-hand limits

4Definitions 1 and 2

ff is continuous at cc (in the domain) when the left-hand limit, right-hand limit and f(c)f(c) are equal; a continuous function is continuous at every point of its domain. Lesson: continuity at a point

Solution

  1. Find the domain and partition it

    Every real number satisfies exactly one of x≥0x \ge 0⁠, x<0x < 0⁠, so ff is defined at every real number: the domain is R\R⁠. Following the book, split R\R into three disjoint sets:

    D1={x∈R:x<0},D2={0},D_1 = \{x \in \R : x < 0\}, \quad D_2 = \{0\}, D3={x∈R:x>0}.D_3 = \{x \in \R : x > 0\}.
    The formula changes at 0 only. Points of D1D_1 and D3D_3 lie strictly inside one piece, so a single formula governs all nearby inputs. The point 0 is where two formulas meet, so it gets its own case.
    D1∪D2∪D3=RD_1 \cup D_2 \cup D_3 = \R and the three sets do not overlap, so these three cases examine every real number exactly once. Basics: piecewise functions
  2. Case 1: points of D1D_1 (c<0c < 0⁠)

    Fix c<0c < 0⁠. Then f(c)=c2f(c) = c^2⁠. Every xx with ∣x−c∣<∣c∣|x - c| < |c| is negative, so near cc we have f(x)=x2f(x) = x^2 and

    lim⁡x→cf(x)=lim⁡x→cx2=c2=f(c).\lim_{x\to c} f(x) = \lim_{x\to c} x^2 = c^2 = f(c).

    So ff is continuous at every point of D1D_1.

    Within distance ∣c∣|c| of a negative number cc all inputs stay negative, so only the rule x2x^2 is used. The book says "it is easy to see" and points to Example 2 (where x2x^2 is shown continuous at 0); the same limit calculation works at any cc⁠.
    The product rule of limits: the limit of x⋅xx \cdot x is the product of the two limits, lim⁡x→cx2=(lim⁡x→cx)(lim⁡x→cx)=c⋅c.\lim_{x\to c} x^2 = \Big(\lim_{x\to c} x\Big)\Big(\lim_{x\to c} x\Big) = c \cdot c. Basics: what a limit is
  3. Case 2: points of D3D_3 (c>0c > 0⁠)

    Fix c>0c > 0⁠. Then f(c)=cf(c) = c⁠. Every xx with ∣x−c∣<c|x - c| < c is positive, so near cc we have f(x)=xf(x) = x and

    lim⁡x→cf(x)=lim⁡x→cx=c=f(c).\lim_{x\to c} f(x) = \lim_{x\to c} x = c = f(c).

    So ff is continuous at every point of D3D_3.

    Near a positive cc⁠, ff is the identity function, which is continuous at every real number by Example 6.
    Example 6: the identity function is continuous.
  4. Case 3: at x=0x = 0⁠, the value

    Since 0≥00 \ge 0⁠, the first line applies:

    f(0)=0.f(0) = 0.
    The condition x≥0x \ge 0 includes the junction point itself. Using x2x^2 would happen to give the same number here, but only by luck; the correct line is the first.
  5. Case 3: the left-hand limit at 0

    For x<0x < 0 the rule is f(x)=x2f(x) = x^2⁠, so

    lim⁡x→0−f(x)=lim⁡x→0−x2=02=0.\lim_{x\to 0^-} f(x) = \lim_{x\to 0^-} x^2 = 0^2 = 0.
    Inputs approaching 0 from the left are negative and use the second line. For example f(−0.1)=0.01f(-0.1) = 0.01 and f(−0.01)=0.0001f(-0.01) = 0.0001⁠: the outputs shrink to 0, even faster than the inputs.
  6. Case 3: the right-hand limit at 0

    For x>0x > 0 the rule is f(x)=xf(x) = x⁠, so

    lim⁡x→0+f(x)=lim⁡x→0+x=0.\lim_{x\to 0^+} f(x) = \lim_{x\to 0^+} x = 0.
    Inputs approaching 0 from the right are positive and use the first line, where the output equals the input, so the outputs go to 0 as well.
  7. Case 3: compare

    lim⁡x→0−f(x)=0,lim⁡x→0+f(x)=0,f(0)=0.\begin{aligned} \lim_{x\to 0^-} f(x) &= 0, \\ \lim_{x\to 0^+} f(x) &= 0, \\ f(0) &= 0. \end{aligned}

    All three are equal, so lim⁡x→0f(x)=0=f(0)\lim_{x\to 0} f(x) = 0 = f(0) and ff is continuous at 0.

    Definition 1 asks for exactly this: both one-sided limits exist, agree, and equal the value. In the graph, the parabola and the line meet at the origin with no gap and no jump.
  8. Conclusion

    Cases 1, 2 and 3 cover every real number, and ff is continuous in each. So ff is continuous at every point of its domain R\R⁠, and by Definition 2, ff is a continuous function.

    x y O −2 −1 1 2 3 1 2 3 4 (−2, 4) (−1, 1) (1, 1) (2, 2) f(0) = 0 y = x² y = x
    The graph of ff⁠, same scale on both axes (compare Fig 5.7). Left of the y-axis it is the parabola y=x2y = x^2 (blue), right of it the line y=xy = x (violet). Both pieces reach the origin, and the filled rose dot is the value f(0)=0f(0) = 0⁠.
    The graph can be drawn in one stroke. It does have a sharp turn at the origin: the parabola arrives flat (slope 0) and the line leaves with slope 1. That corner does not affect continuity; it matters for differentiability, which Section 5.3 studies.
Result

ff is continuous at every c<0c < 0⁠, at every c>0c > 0⁠, and at 0 (left-hand limit, right-hand limit and f(0)f(0) all equal 0). Hence ff is a continuous function; it has no point of discontinuity. This agrees with the textbook's solution.

Check it with numbers

Near 0: f(−0.1)=0.01f(-0.1) = 0.01⁠, f(−0.001)=0.000001f(-0.001) = 0.000001⁠, f(0)=0f(0) = 0⁠, f(0.001)=0.001f(0.001) = 0.001⁠, f(0.1)=0.1f(0.1) = 0.1⁠. All approach 0 from both sides. Near c=−2c = -2⁠: f(−2)=4f(-2) = 4⁠, f(−2.001)=4.004001f(-2.001) = 4.004001⁠, f(−1.999)=3.996001f(-1.999) = 3.996001⁠, both close to 4.

Common mistakes
  1. Taking f(0)f(0) from the wrong line. "x≥0x \ge 0" contains 0, so the first line gives f(0)f(0)⁠.
  2. Skipping the junction. Knowing each piece is continuous is not enough; two continuous pieces can still meet with a jump (as in Example 10). The point 0 must be tested.
  3. Confusing a corner with a break. The graph turns sharply at 0 but has no gap, so ff is continuous there.
What to take away
  1. Partition the domain into the open pieces and the junction points; handle the open pieces by the formulas and each junction by three separate numbers.
  2. When the two one-sided limits at a junction agree and equal the value, the function is continuous there, however different the two formulas look.
  3. Continuity allows corners; Section 5.3 shows that corners are where differentiability can fail.

Every fact used, and where it comes from

FactUsed inSource
"x≥0x \ge 0" includes 0; each line applies only on its conditionSteps 1, 4Definition of a piecewise function (Basics: piecewise functions)
lim⁡x→cx2=c2\lim_{x\to c} x^2 = c^2Steps 2, 5Algebra of limits, Class XI; Example 2, Section 5.2 (Basics: limits)
lim⁡x→cx=c\lim_{x\to c} x = cSteps 3, 6Example 6, Section 5.2
One-sided limitsSteps 5–7Section 5.2 (Basics: one-sided limits)
Continuity at a point; continuous functionSteps 2, 3, 7, 8Definitions 1 and 2, Section 5.2 (Lesson: continuity at a point)
Graph of ffStep 8Fig 5.7, Section 5.2
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →