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

Example 7: Is f(x)=∣x∣f(x)=|x| a continuous function?

ExamplesContinuous functions · Section 5.2
The question

Is the function defined by f(x)=∣x∣f(x) = |x|⁠, a continuous function?

Exam answer f(x)=∣x∣={−x,if x<0x,if x≥0f(x) = |x| = \begin{cases} -x, & \text{if } x < 0 \\ x, & \text{if } x \ge 0 \end{cases}

Let cc be any real number.

Case 1: c<0c < 0⁠. Then f(c)=−cf(c) = -c and

lim⁡x→cf(x)=lim⁡x→c(−x)=−c\lim_{x\to c} f(x) = \lim_{x\to c}(-x) = -c

So lim⁡x→cf(x)=f(c)\lim_{x\to c} f(x) = f(c)⁠, and ff is continuous at cc⁠.

Case 2: c>0c > 0⁠. Then f(c)=cf(c) = c and

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

So lim⁡x→cf(x)=f(c)\lim_{x\to c} f(x) = f(c)⁠, and ff is continuous at cc⁠.

Case 3: c=0c = 0⁠. Then f(0)=0f(0) = 0 and

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

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

Yes. ff is continuous at every real number, so f(x)=∣x∣f(x) = |x| is a continuous function.

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

The one idea this problem is built on

Away from 0, ∣x∣|x| is a single simple formula in a whole neighbourhood of the point: near a negative number every xx is negative, so ∣x∣=−x|x| = -x there; near a positive number ∣x∣=x|x| = x⁠. Only at 0 do the two formulas meet, and Example 3 has already handled 0. So we split the real line into three cases: c<0c < 0⁠, c=0c = 0⁠, c>0c > 0⁠.

Given, to find, and the plan
Given
f(x)=∣x∣f(x) = |x|⁠, that is f(x)=−xf(x) = -x if x<0x < 0 and f(x)=xf(x) = x if x≥0x \ge 0⁠.
To find
Whether ff is continuous at every point of its domain (Definition 2).
Plan
Domain is R\R⁠. Case c=0c = 0⁠: Example 3. Case c<0c < 0⁠: show only the formula −x-x is used near cc⁠, then compare limits with f(c)f(c)⁠. Case c>0c > 0⁠: the same with the formula xx⁠. Answer the textbook's two "(Why?)" questions on the way.

Basics you need

1The absolute value, piece by piece

∣x∣=−x|x| = -x when x<0x < 0 and ∣x∣=x|x| = x when x≥0x \ge 0⁠. It is the distance from xx to 0. Basics: piecewise functions

2A limit only looks near the point

lim⁡x→cf(x)\lim_{x\to c} f(x) depends only on the values of ff at points xx close to cc⁠. If ff agrees with a simpler formula on a small interval around cc⁠, the limit can be computed with that formula. Basics: what a limit is

3One-sided limits

The limit at cc exists when the left-hand and right-hand limits exist and agree. Basics: left-hand and right-hand limits

4Definitions 1 and 2

Continuous at cc⁠: left-hand limit = right-hand limit = f(c)f(c)⁠. Continuous function: continuous at every point of the domain. Lesson: continuity at a point

Solution

  1. Domain, and the three cases

    ∣x∣|x| is defined for every real number, so the domain is R\R⁠. We rewrite ff as

    f(x)={−x,if x<0x,if x≥0f(x) = \begin{cases} -x, & \text{if } x < 0 \\ x, & \text{if } x \ge 0 \end{cases}

    and examine an arbitrary real number cc in three cases: c<0c < 0⁠, c=0c = 0 and c>0c > 0⁠. Every real number falls in exactly one case.

    Definition 2 asks for continuity at every point of the domain. The formula changes at 0, so 0 behaves differently from the other points and must be treated on its own; the negative and positive points each have a single formula nearby.
    Splitting into cases is a valid proof as long as the cases together cover every possibility. Basics: piecewise functions
  2. Case c=0c = 0⁠: already done

    By Example 3, lim⁡x→0−∣x∣=0\lim_{x\to0^-}|x| = 0⁠, lim⁡x→0+∣x∣=0\lim_{x\to0^+}|x| = 0 and f(0)=0f(0) = 0⁠. So ff is continuous at x=0x = 0⁠.

    This is the one point where the left and right formulas differ, so the one-sided limits had to be computed separately with −x-x and xx⁠; Example 3 did exactly that.
  3. Case c<0c < 0⁠: only the formula −x-x is used near cc

    Let c<0c < 0⁠. Then f(c)=−cf(c) = -c⁠. Now take any xx with ∣x−c∣<∣c∣|x - c| < |c|⁠, that is, any xx between 2c2c and 0. Every such xx is negative, so f(x)=−xf(x) = -x there. Hence

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

    Both one-sided limits equal −c=f(c)-c = f(c)⁠, so ff is continuous at cc⁠, for every c<0c < 0⁠.

    This answers the textbook's first "(Why?)": the limit is computed with −x-x because, close to a negative number cc⁠, every xx is negative as well, and for negative xx the rule is −x-x⁠. For c=−2c = -2⁠, every xx in (−4,0)(-4, 0) is negative, and in particular every xx in the gold strip of the figure. Then lim⁡(−x)=−lim⁡x=−c\lim(-x) = -\lim x = -c⁠.
    For c<0c < 0⁠, ∣c∣=−c|c| = -c⁠, so f(c)=−cf(c) = -c is a positive number: for c=−2c = -2⁠, f(−2)=2f(-2) = 2⁠. Basics: what a limit is
  4. Case c>0c > 0⁠: only the formula xx is used near cc

    Let c>0c > 0⁠. Then f(c)=cf(c) = c⁠. Every xx with ∣x−c∣<c|x - c| < c⁠, that is every xx between 0 and 2c2c⁠, is positive, so f(x)=xf(x) = x there. Hence

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

    Both equal f(c)=cf(c) = c⁠, so ff is continuous at every c>0c > 0⁠.

    This answers the second "(Why?)": near a positive number every xx is positive, so f(x)=xf(x) = x there, and lim⁡x→cx=c\lim_{x\to c} x = c (as in Example 6).
    The window ∣x−c∣<∣c∣|x - c| < |c| is chosen so that it never reaches 0, the only place where the formula changes. Basics: one-sided limits
  5. Put the three cases together

    ff is continuous at every c<0c < 0 (Step 3), at c=0c = 0 (Step 2) and at every c>0c > 0 (Step 4). These cases cover all of R\R⁠, the domain. By Definition 2, f(x)=∣x∣f(x) = |x| is a continuous function.

    Definition 2 needs continuity at every point of the domain, and the three cases leave no real number out.
x y −3 −2 −1 1 2 3 1 2 3 (−2, 2) (2, 2) near c = −2 every x is negative: f(x) = −x there near c = 2 every x is positive: f(x) = x there c = 0: done in Example 3
The graph of y=∣x∣y = |x| (same scale on both axes). Inside the gold strip around c=−2c = -2 only the arm y=−xy = -x appears, and inside the blue strip around c=2c = 2 only the arm y=xy = x⁠; each arm is a straight line, so the graph is unbroken there. The corner at the origin (violet) is Example 3.
Result

Yes. f(x)=∣x∣f(x) = |x| is continuous at every negative number, at 0 and at every positive number, so it is continuous at every point of its domain R\R⁠: ∣x∣|x| is a continuous function. This is the textbook's conclusion.

Check it with numbers

At c=−2c = -2⁠: f(−2.001)=2.001f(-2.001) = 2.001 and f(−1.999)=1.999f(-1.999) = 1.999⁠, each 0.0010.001 from f(−2)=2f(-2) = 2⁠. At c=2c = 2⁠: f(1.999)=1.999f(1.999) = 1.999 and f(2.001)=2.001f(2.001) = 2.001⁠, each 0.0010.001 from f(2)=2f(2) = 2⁠. The table below repeats this with three distances.

xxf(x)f(x)near
−2.01-2.012.012.01c=−2c = -2
−1.99-1.991.991.99c=−2c = -2
−1.9-1.91.91.9c=−2c = -2
1.91.91.91.9c=2c = 2
1.991.991.991.99c=2c = 2
2.012.012.012.01c=2c = 2
Common mistakes
  1. Checking only x=0x = 0⁠. "A continuous function" means continuous at every point of the domain, so the negative and positive points need an argument too.
  2. Writing f(c)=cf(c) = c for c<0c < 0⁠. For negative cc⁠, ∣c∣=−c|c| = -c⁠, which is positive.
  3. Not justifying the formula near cc⁠. Saying "lim⁡∣x∣=lim⁡(−x)\lim |x| = \lim(-x)" needs the reason: all xx near a negative cc are negative.
What to take away
  1. For a piecewise function, points strictly inside a piece are tested with that piece's formula; only the junction points need separate left and right calculations.
  2. To justify using one formula near cc⁠, name an interval around cc that stays inside one piece (here ∣x−c∣<∣c∣|x - c| < |c|⁠).
  3. ∣x∣|x| is continuous everywhere, even though its graph has a corner at 0.

Every fact used, and where it comes from

FactUsed inSource
∣x∣=−x|x| = -x for x<0x < 0⁠, ∣x∣=x|x| = x for x≥0x \ge 0Steps 1, 3, 4Definition of absolute value (Basics: piecewise functions)
∣x∣|x| is continuous at 0Step 2Example 3, Section 5.2
Limit depends only on values near ccSteps 3, 4Meaning of a limit (Basics: what a limit is)
lim⁡x→cx=c\lim_{x\to c} x = c⁠, lim⁡x→c(−x)=−c\lim_{x\to c} (-x) = -cSteps 3, 4Algebra of limits, Class XI; Example 6
Continuous at cc⁠; continuous functionSteps 3–5Definitions 1 and 2, Section 5.2 (Lesson: continuity at a point)
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 →