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

Example 12: x+2x+2 for x<0x<0⁠, −x+2-x+2 for x>0x>0⁠: continuous on its domain

ExamplesContinuity of piecewise functions · Section 5.2
The question

Discuss the continuity of the function defined by

f(x)={x+2,if x<0−x+2,if x>0f(x) = \begin{cases} x + 2, & \text{if } x < 0 \\ -x + 2, & \text{if } x > 0 \end{cases}
Exam answer

ff is not defined at x=0x = 0⁠, so its domain is all real x≠0x \ne 0⁠. (So x=0x = 0 is not a point of discontinuity.)

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

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

∴ f\therefore\ f is continuous at every point of its domain, 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

Continuity is only tested at points of the domain. Neither line of the definition covers x=0x = 0⁠, so 0 is not in the domain of ff⁠. Every point that is in the domain lies strictly inside one of the two pieces, where ff is a straight line and hence continuous. So ff is continuous at every point of its domain, which by Definition 2 makes it a continuous function, even though its graph has a gap at x=0x = 0⁠.

Given, to find, and the plan
Given
f(x)=x+2f(x) = x + 2 for x<0x < 0 and f(x)=−x+2f(x) = -x + 2 for x>0x > 0⁠; no rule for x=0x = 0⁠.
To find
At which points ff is continuous, and whether ff is a continuous function.
Plan
Find the domain D1∪D2D_1 \cup D_2⁠. Show continuity at every point of D1D_1 and of D2D_2⁠. Then explain why x=0x = 0 is not examined, and apply Definition 2.

Basics you need

1The domain of a piecewise function

A piecewise function is defined exactly at the inputs covered by one of its conditions. A strict inequality such as x<0x < 0 does not include 0. Basics: piecewise functions

2Limit of a straight line

lim⁡x→c(mx+a)=mc+a\lim_{x\to c}(mx + a) = mc + a for constants mm⁠, aa (algebra of limits, Class XI). Basics: what a limit is

3Definition 1 and Definition 2

Definition 1: for cc in the domain, ff is continuous at cc if lim⁡x→cf(x)=f(c)\lim_{x\to c} f(x) = f(c)⁠. Definition 2: ff is a continuous function if it is continuous at every point of its domain. Lesson: continuity at a point

4One-sided limits

Used in Step 4 only, to see what happens near the excluded point 0: the left-hand limit uses x<0x < 0⁠, the right-hand limit uses x>0x > 0⁠. Basics: left-hand and right-hand limits

Solution

  1. Find the domain

    The first line covers every x<0x < 0⁠, the second every x>0x > 0⁠. The number 0 satisfies neither condition, and no line gives a value for it. So the domain is

    D1∪D2,D1={x∈R:x<0},D_1 \cup D_2, \quad D_1 = \{x \in \R : x < 0\}, D2={x∈R:x>0}.D_2 = \{x \in \R : x > 0\}.

    In other words, ff is defined at all real numbers except 0.

    Before asking "is ff continuous at cc⁠?" we must know which cc are allowed. Definition 1 only speaks about points cc in the domain, so finding the domain first tells us exactly which points to test.
    x<0x < 0 and x>0x > 0 are strict inequalities: neither includes 0. Compare Example 13, where "x≥0x \ge 0" does include 0. Basics: piecewise functions
  2. Points of D1D_1 (c<0c < 0⁠)

    Fix c<0c < 0⁠. Then f(c)=c+2f(c) = c + 2⁠. Every xx with ∣x−c∣<∣c∣|x - c| < |c| satisfies x<c+∣c∣=0x < c + |c| = 0⁠, so near cc we have f(x)=x+2f(x) = x + 2 and

    lim⁡x→cf(x)=lim⁡x→c(x+2)=c+2=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.

    The distance from cc to 0 is ∣c∣=−c|c| = -c⁠. Inside that distance we never reach 0 or the positive numbers, so near cc the function is just the line x+2x + 2⁠, and the limit of a line is found by substituting.
  3. Points of D2D_2 (c>0c > 0⁠)

    Fix c>0c > 0⁠. Then f(c)=−c+2f(c) = -c + 2⁠. Every xx with ∣x−c∣<c|x - c| < c satisfies x>c−c=0x > c - c = 0⁠, so near cc we have f(x)=−x+2f(x) = -x + 2 and

    lim⁡x→cf(x)=lim⁡x→c(−x+2)=−c+2=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 D2D_2.

    Same reasoning on the positive side: within distance cc of cc all inputs are positive, so only the rule −x+2-x + 2 is used.
  4. What about x=0x = 0⁠?

    0 is not in the domain, so f(0)f(0) does not exist and Definition 1 does not apply at 0. In this book's sense, 0 is neither a point of continuity nor a point of discontinuity: it is simply not a point where the question is asked.

    It is still instructive to look at the one-sided limits there, because a limit does not need f(0)f(0)⁠:

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

    So lim⁡x→0f(x)=2\lim_{x\to 0} f(x) = 2 exists, but there is no value f(0)f(0) to compare it with.

    This is the heart of the example. The graph has a gap at (0,2)(0, 2)⁠, so to draw it we must lift the pen. The book's point is that lifting the pen only at a point where ff is not defined does not spoil continuity of the function: continuity is a statement about points of the domain only, exactly as for 1x\frac{1}{x} in Example 9.
    If we added the value f(0)=2f(0) = 2⁠, the new function would be 2−∣x∣2 - |x|⁠, continuous at 0 as well. But that is a different function from the one in the question. Basics: one-sided limits
  5. Conclusion

    By Steps 2 and 3, ff is continuous at every point of its domain D1∪D2D_1 \cup D_2⁠. By Definition 2, ff is a continuous function.

    x y O −4 −3 −2 −1 1 2 3 4 −2 −1 1 3 (0, 2) not on the graph y = x + 2 y = −x + 2
    The graph of ff⁠, same scale on both axes (compare Fig 5.6). The blue line y=x+2y = x + 2 for x<0x < 0 and the violet line y=−x+2y = -x + 2 for x>0x > 0 both head for (0,2)(0, 2)⁠, drawn as an open dot because ff has no value at 0.
    Definition 2 asks for continuity at every point of the domain, and Steps 2 and 3 cover all of it. The excluded point 0 is not part of the requirement.
Result

ff is defined at every real number except 0 and is continuous at every point of its domain {x:x<0}∪{x:x>0}\{x : x < 0\} \cup \{x : x > 0\}⁠. Hence ff is a continuous function; the point 0, not being in the domain, is not a point of discontinuity. This agrees with the textbook's solution.

Check it with numbers

At c=−1c = -1⁠: f(−1)=1f(-1) = 1⁠, f(−1.001)=0.999f(-1.001) = 0.999⁠, f(−0.999)=1.001f(-0.999) = 1.001⁠, all close to 1. At c=3c = 3⁠: f(3)=−1f(3) = -1⁠, f(2.999)=−0.999f(2.999) = -0.999⁠, f(3.001)=−1.001f(3.001) = -1.001⁠. Near the gap: f(−0.001)=1.999f(-0.001) = 1.999 and f(0.001)=1.999f(0.001) = 1.999⁠, both close to 2, while f(0)f(0) is undefined.

Common mistakes
  1. Calling 0 a point of discontinuity. A point of discontinuity must be in the domain. 0 is not, so this function has no points of discontinuity at all.
  2. Reading x<0x < 0 as x≤0x \le 0⁠. Then f(0)f(0) would be 2. The book's definition uses strict inequalities on both lines.
  3. Equating "continuous" with "drawn without lifting the pen". That picture works on an interval. Here the domain itself has a hole, and the pen is lifted only there.
What to take away
  1. Always find the domain first: continuity questions are asked only at points of the domain.
  2. A gap in the graph at a point outside the domain does not make the function discontinuous (Definition 2).
  3. Same lesson as Example 9 (1x\frac{1}{x}⁠) and later Example 18 (tan⁡x\tan x⁠): continuous functions can have graphs in several pieces.

Every fact used, and where it comes from

FactUsed inSource
A piecewise function is defined only where a condition holdsStep 1Definition of a piecewise function (Basics: piecewise functions)
lim⁡x→c(±x+2)=±c+2\lim_{x\to c}(\pm x + 2) = \pm c + 2Steps 2, 3, 4Algebra of limits, Class XI (Basics: limits)
Continuity is defined at points of the domainSteps 2–4Definition 1, Section 5.2 (Lesson: continuity at a point)
Continuous function = continuous at every point of the domainStep 5Definition 2, Section 5.2
One-sided limitsStep 4Section 5.2 (Basics: one-sided limits)
A function undefined at 0 can still be continuousStep 4Example 9, Section 5.2
Graph of ffStep 5Fig 5.6, 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 →