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

Example 20: ∣1−x+∣x∣∣|1-x+|x|| is a continuous function

ExamplesAlgebra of continuous functions · Section 5.2.1
The question

Show that the function ff defined by

f(x)=∣1−x+∣x∣∣,f(x) = |1 - x + |x||,

where xx is any real number, is a continuous function.

Exam answer

Let g(x)=1−x+∣x∣g(x) = 1 - x + |x| and h(x)=∣x∣h(x) = |x|⁠. Then

h(g(x))=∣1−x+∣x∣∣=f(x)h(g(x)) = |1 - x + |x|| = f(x)

1−x1 - x is a polynomial and ∣x∣|x| is continuous, so their sum gg is continuous at every real number. Also h(x)=∣x∣h(x) = |x| is continuous at every real number.

A composite of continuous functions is continuous, so f(x)=h(g(x))f(x) = h(g(x)) is continuous at every real number.

∴ f\therefore\ f is a continuous function. Hence proved.

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

The one idea this problem is built on

Build ff in layers. The inside, g(x)=1−x+∣x∣g(x) = 1 - x + |x|⁠, is a sum of a polynomial and the modulus function, both continuous, so gg is continuous (Theorem 1). Then ff is the modulus of gg⁠: a composite h∘gh \circ g with h(x)=∣x∣h(x) = |x| continuous, so ff is continuous (Theorem 2). No case analysis is needed, although doing one gives a useful check.

Given, to show, and the plan
Given
f(x)=∣1−x+∣x∣∣f(x) = |1 - x + |x|| for every real xx⁠.
To show
ff is continuous at every real number.
Plan
Write f=h∘gf = h \circ g with g(x)=1−x+∣x∣g(x) = 1 - x + |x| and h(x)=∣x∣h(x) = |x|⁠. Show gg is continuous using Example 14, Example 7 and Theorem 1(1). Apply Theorem 2 with hh continuous (Example 7). Finally check by writing ff without modulus signs and testing the junction x=0x = 0⁠.

Basics you need

1The modulus function is continuous

∣x∣|x| is continuous at every real number (Example 7, using Example 3 at 0).

2Theorem 1(1)

If two functions are continuous at cc⁠, so is their sum. Lesson: algebra of continuous functions

3Theorem 2

If gg is continuous at cc and hh is continuous at g(c)g(c)⁠, then h∘gh \circ g is continuous at cc⁠. Basics: composite functions

4Removing a modulus sign

∣x∣=x|x| = x when x≥0x \ge 0 and ∣x∣=−x|x| = -x when x<0x < 0⁠. This turns ff into a piecewise function for the check in Step 6. Basics: piecewise functions

Solution

  1. The domain, and the inner and outer functions

    1−x+∣x∣1 - x + |x| and its modulus can be computed for every real xx⁠, so the domain of ff is R\R⁠. Following the book, define

    g(x)=1−x+∣x∣,h(x)=∣x∣.g(x) = 1 - x + |x|, \qquad h(x) = |x|.

    Then

    (h∘g)(x)=h(g(x))=h(1−x+∣x∣)=∣1−x+∣x∣∣=f(x).\begin{aligned} (h \circ g)(x) &= h(g(x)) \\ &= h(1 - x + |x|) \\ &= |1 - x + |x|| = f(x). \end{aligned}
    The last operation in computing f(x)f(x) is the outer modulus, so h=∣⋅∣h = |\cdot| is the outer function, and everything inside it, 1−x+∣x∣1 - x + |x|⁠, is the inner function gg⁠. (The inner gg contains its own ∣x∣|x|⁠; that is part of gg⁠, not of hh⁠.)
  2. The pieces of gg are continuous

    g(x)=(1−x)+∣x∣g(x) = (1 - x) + |x| is a sum of two functions:

    • 1−x1 - x is a polynomial, continuous at every real number (Example 14);
    • ∣x∣|x| is continuous at every real number (Example 7).
    To use Theorem 1(1) we need each summand to be continuous at the point; both are continuous at every real number.
  3. So gg is continuous (Theorem 1)

    By Theorem 1(1), the sum g=(1−x)+∣x∣g = (1 - x) + |x| is continuous at every real number cc⁠:

    lim⁡x→cg(x)=1−c+∣c∣=g(c).\lim_{x\to c} g(x) = 1 - c + |c| = g(c).
    This is the book's sentence "gg being a sum of a polynomial function and the modulus function is continuous".
    Theorem 1(1), Section 5.2.1. Lesson: algebra of continuous functions
  4. The outer function is continuous at g(c)g(c)

    h(x)=∣x∣h(x) = |x| is continuous at every real number (Example 7), in particular at the number g(c)g(c)⁠.

    Theorem 2 needs the outer function continuous at the inner value g(c)g(c)⁠. Because ∣x∣|x| is continuous everywhere, this holds whatever g(c)g(c) is.
  5. Apply Theorem 2

    gg is continuous at cc (Step 3) and hh is continuous at g(c)g(c) (Step 4), so by Theorem 2 f=h∘gf = h \circ g is continuous at cc⁠. As cc was any real number, ff is a continuous function.

    As x→cx \to c⁠, the inner value g(x)g(x) approaches g(c)g(c)⁠, and then its modulus approaches ∣g(c)∣=f(c)|g(c)| = f(c)⁠.
    Theorem 2, Section 5.2.1. Lesson: algebra of continuous functions
  6. A check: write ff without modulus signs

    For x≥0x \ge 0⁠, ∣x∣=x|x| = x⁠, so g(x)=1−x+x=1g(x) = 1 - x + x = 1⁠. For x<0x < 0⁠, ∣x∣=−x|x| = -x⁠, so g(x)=1−2xg(x) = 1 - 2x⁠, which is greater than 1 because −2x>0-2x > 0⁠. So g(x)≥1>0g(x) \ge 1 > 0 for every xx⁠, the outer modulus changes nothing, and

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

    Each piece is a polynomial. A point c≠0c \ne 0 has an interval around it, of radius ∣c∣|c|⁠, that stays on one side of 0, so near cc the function ff is a single polynomial and is continuous at cc (Example 14). At the junction x=0x = 0⁠:

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

    All three equal 1, so ff is continuous at 0 as well, confirming Step 5.

    x y O −2 −1 1 2 3 1 2 3 4 5 (−1, 3) (−2, 5) (0, 1) y = 1 − 2x y = 1
    The graph of ff⁠, same scale on both axes. For x<0x < 0 it is the blue line y=1−2xy = 1 - 2x through (−2,5)(-2, 5) and (−1,3)(-1, 3)⁠; for x≥0x \ge 0 it is the violet horizontal line y=1y = 1⁠. They meet at (0,1)(0, 1) with a corner but no break.
    The case analysis is not needed for the proof, but it shows concretely what Theorems 1 and 2 guarantee: the two pieces meet at the same height. The corner at (0,1)(0, 1) is allowed; continuity only forbids gaps and jumps.
Result

f=h∘gf = h \circ g with g(x)=1−x+∣x∣g(x) = 1 - x + |x| continuous (Theorem 1) and h(x)=∣x∣h(x) = |x| continuous (Example 7), so by Theorem 2 f(x)=∣1−x+∣x∣∣f(x) = |1 - x + |x|| is a continuous function. Explicitly, f(x)=1f(x) = 1 for x≥0x \ge 0 and f(x)=1−2xf(x) = 1 - 2x for x<0x < 0⁠. This agrees with the textbook's solution.

Check it with numbers

f(−1)=∣1+1+1∣=3f(-1) = |1 + 1 + 1| = 3 and 1−2(−1)=31 - 2(-1) = 3⁠; f(2)=∣1−2+2∣=1f(2) = |1 - 2 + 2| = 1⁠. Near 0: f(−0.001)=∣1+0.001+0.001∣f(-0.001) = |1 + 0.001 + 0.001| =1.002= 1.002⁠, f(0)=1f(0) = 1⁠, f(0.001)=∣1−0.001+0.001∣=1f(0.001) = |1 - 0.001 + 0.001| = 1⁠. The values on both sides approach f(0)=1f(0) = 1⁠.

Common mistakes
  1. Choosing the wrong outer function. The outer function is the last modulus; the ∣x∣|x| inside belongs to the inner function gg⁠.
  2. Simplifying ∣1−x+∣x∣∣|1 - x + |x|| as 1−x+x1 - x + x⁠. That is only valid for x≥0x \ge 0⁠; for x<0x < 0⁠, ∣x∣=−x|x| = -x⁠.
  3. Stopping at gg⁠. Showing gg continuous is not the end; Theorem 2 is needed to pass continuity through the outer modulus.
What to take away
  1. Theorems 1 and 2 together handle formulas built from known continuous functions by ++⁠, −-⁠, ×\times⁠, ÷\div and composition, with no limits to compute.
  2. A piecewise check at the junctions is a good way to confirm such an argument.
  3. Continuous does not mean smooth: ff has a corner at x=0x = 0⁠, the kind of point where Section 5.3 shows differentiability can fail.

Every fact used, and where it comes from

FactUsed inSource
(h∘g)(x)=h(g(x))(h \circ g)(x) = h(g(x))Step 1Composition of functions, Chapter 1 (Basics: composite functions)
Polynomials are continuousSteps 2, 6Example 14, Section 5.2
∣x∣|x| is continuousSteps 2, 4Example 7, Section 5.2
Sum of continuous functions is continuousStep 3Theorem 1(1), Section 5.2.1 (Lesson: algebra of continuous functions)
Composite of continuous functions is continuousStep 5Theorem 2, Section 5.2.1
∣x∣=x|x| = x for x≥0x \ge 0⁠, −x-x for x<0x < 0Step 6Definition of modulus (Basics: piecewise functions)
Continuity at a junction: LHL = RHL = valueStep 6Definition 1, 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 →