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

Miscellaneous · Q18: f(x)=∣x∣3f(x)=|x|^3 has f′′(x)=6∣x∣f''(x)=6|x| for all real xx

Miscellaneous ExerciseDifferentiability · Second order derivative · Miscellaneous Exercise
The question

If f(x)=∣x∣3f(x) = |x|^3⁠, show that f′′(x)f''(x) exists for all real xx and find it.

Exam answer f(x)=∣x∣3={x3,x≥0−x3,x<0f(x) = |x|^3 = \begin{cases} x^3, & x \ge 0 \\ -x^3, & x \lt 0 \end{cases}

For ff at x=0x = 0⁠, with f(0)=0f(0) = 0⁠:

LHD=lim⁡h→0−−h3−0h=lim⁡h→0−(−h2)=0RHD=lim⁡h→0+h3−0h=lim⁡h→0+h2=0\begin{aligned} \text{LHD} &= \lim_{h\to0^-}\frac{-h^3 - 0}{h} \\ &= \lim_{h\to0^-}(-h^2) = 0 \\ \text{RHD} &= \lim_{h\to0^+}\frac{h^3 - 0}{h} \\ &= \lim_{h\to0^+}h^2 = 0 \end{aligned}

LHD == RHD, so ff is differentiable at x=0x = 0 and f′(0)=0f'(0) = 0⁠. Hence

f′(x)={3x2,x≥0−3x2,x<0f'(x) = \begin{cases} 3x^2, & x \ge 0 \\ -3x^2, & x \lt 0 \end{cases}

For f′f' at x=0x = 0⁠, with f′(0)=0f'(0) = 0⁠:

LHD=lim⁡h→0−−3h2−0h=lim⁡h→0−(−3h)=0RHD=lim⁡h→0+3h2−0h=lim⁡h→0+3h=0\begin{aligned} \text{LHD} &= \lim_{h\to0^-}\frac{-3h^2 - 0}{h} \\ &= \lim_{h\to0^-}(-3h) = 0 \\ \text{RHD} &= \lim_{h\to0^+}\frac{3h^2 - 0}{h} \\ &= \lim_{h\to0^+}3h = 0 \end{aligned}

LHD == RHD, so f′f' is differentiable at x=0x = 0 and f′′(0)=0f''(0) = 0⁠. For x≠0x \ne 0⁠, differentiating each piece,

f′′(x)=6xf''(x) = 6x for x≥0x \ge 0 and f′′(x)=−6xf''(x) = -6x for x<0x \lt 0⁠, i.e. f′′(x)=6∣x∣f''(x) = 6|x|⁠, which exists for all real xx⁠.

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

The one idea this problem is built on

Away from 0, ∣x∣3|x|^3 is just x3x^3 or −x3-x^3⁠, so ordinary rules work. At the junction x=0x = 0 we must not differentiate a formula; we use the definition, computing the left-hand and right-hand difference quotients separately. We do this twice: once for f′(0)f'(0)⁠, and once more, applied to f′f'⁠, for f′′(0)f''(0)⁠.

Given, to show, and the plan
Given
f(x)=∣x∣3f(x) = |x|^3 for all real xx⁠.
To show / find
f′′(x)f''(x) exists at every real xx⁠, and its formula.
Plan
(1) Write ff piecewise. (2) f′f' for x≠0x \ne 0⁠. (3) f′(0)f'(0) from one-sided difference quotients. (4) One formula for f′f'⁠. (5) f′′f'' for x≠0x \ne 0⁠. (6) f′′(0)f''(0) from one-sided difference quotients of f′f'⁠. (7) Conclude.

Basics you need

1Absolute value, piecewise

∣x∣=x|x| = x for x≥0x \ge 0 and −x-x for x<0x < 0⁠. Basics: piecewise functions

2Derivative at a point, one side at a time

ff is differentiable at cc if lim⁡h→0−f(c+h)−f(c)h\lim\limits_{h\to0^-}\frac{f(c+h) - f(c)}{h} and lim⁡h→0+f(c+h)−f(c)h\lim\limits_{h\to0^+}\frac{f(c+h) - f(c)}{h} are finite and equal; the common value is f′(c)f'(c) (Section 5.3). Basics: left-hand and right-hand limits

3Power rule

ddxxn=nxn−1\frac{d}{dx}x^n = nx^{n-1} (Table 5.3). Basics: derivative rules

4Second order derivative

f′′f'' is the derivative of f′f' (Section 5.7). So f′′(c)f''(c) exists when f′f' is differentiable at cc⁠. Lesson: second order derivative

Solution

  1. Write ff without the absolute value

    f(x)=∣x∣3={x3,x≥0,−x3,x<0.f(x) = |x|^3 = \begin{cases} x^3, & x \ge 0, \\ -x^3, & x < 0. \end{cases}
    For x<0x < 0⁠, ∣x∣=−x|x| = -x⁠, so ∣x∣3=(−x)3=−x3|x|^3 = (-x)^3 = -x^3⁠. Note that −x3-x^3 is positive when xx is negative, as ∣x∣3|x|^3 must be.
    ∣x∣|x| piecewise (Basic 1). Basics: piecewise functions
  2. f′(x)f'(x) for x≠0x \ne 0

    For x>0x > 0⁠: f′(x)=3x2f'(x) = 3x^2⁠. For x<0x < 0⁠: f′(x)=−3x2f'(x) = -3x^2⁠.

    Take x>0x > 0⁠. For all small enough hh (∣h∣<x|h| < x⁠), both xx and x+hx + h are positive, so the difference quotient f(x+h)−f(x)h\frac{f(x+h) - f(x)}{h} only ever uses the formula x3x^3⁠. Its limit is therefore the derivative of x3x^3⁠. The same argument works for x<0x < 0 with −x3-x^3⁠. At x=0x = 0 this fails, because hh of either sign takes us onto different formulas; that is why 0 is treated separately.
    Power rule (Basic 3) and constant multiple rule, Section 5.3. Basics: derivative rules
  3. f′(0)f'(0) from the two one-sided difference quotients

    Here f(0)=0f(0) = 0⁠, so the difference quotient is f(h)−0h=∣h∣3h\frac{f(h) - 0}{h} = \frac{|h|^3}{h}⁠.

    Left (h<0h < 0⁠): ∣h∣3=−h3|h|^3 = -h^3⁠, so

    lim⁡h→0−−h3h=lim⁡h→0−(−h2)=0.\lim_{h\to0^-}\frac{-h^3}{h} = \lim_{h\to0^-}(-h^2) = 0.

    Right (h>0h > 0⁠): ∣h∣3=h3|h|^3 = h^3⁠, so

    lim⁡h→0+h3h=lim⁡h→0+h2=0.\lim_{h\to0^+}\frac{h^3}{h} = \lim_{h\to0^+}h^2 = 0.

    Both are finite and equal, so ff is differentiable at 0 and f′(0)=0f'(0) = 0⁠.

    This is the book's definition of differentiability at a point, used exactly as in its discussion of ∣x∣|x| after Theorem 3. For ∣x∣|x| itself the two quotients were −1-1 and 11 (a corner). For ∣x∣3|x|^3 both are 0: cubing flattens the corner completely.
    Left-hand and right-hand derivatives, Section 5.3 (Basic 2). Lesson: differentiability
  4. One formula for f′f'

    f′(x)={3x2,x>0,0,x=0,−3x2,x<0,f'(x) = \begin{cases} 3x^2, & x > 0, \\ 0, & x = 0, \\ -3x^2, & x < 0, \end{cases}

    that is, in one formula,

    f′(x)=3x∣x∣for every real x.f'(x) = 3x|x| \quad \text{for every real } x.
    Check each piece: for x>0x > 0⁠, 3x∣x∣=3x23x|x| = 3x^2⁠; for x<0x < 0⁠, 3x∣x∣=3x(−x)=−3x23x|x| = 3x(-x) = -3x^2⁠; at 0 it gives 0. So f′f' exists at every real xx⁠. The compact form 3x∣x∣3x|x| is handy for the next derivative.
    ∣x∣|x| piecewise (Basic 1).
  5. f′′(x)f''(x) for x≠0x \ne 0

    For x>0x > 0⁠: f′′(x)=ddx(3x2)=6xf''(x) = \frac{d}{dx}(3x^2) = 6x⁠. For x<0x < 0⁠: f′′(x)=ddx(−3x2)=−6xf''(x) = \frac{d}{dx}(-3x^2) = -6x⁠.

    The same reasoning as Step 2: on the open interval x>0x > 0⁠, f′f' agrees with the polynomial 3x23x^2⁠, so its derivative there is that polynomial's derivative; likewise for x<0x < 0⁠.
    Power rule (Table 5.3); second derivative is the derivative of f′f' (Section 5.7). Lesson: second order derivative
  6. f′′(0)f''(0) from the one-sided difference quotients of f′f'

    Now apply the definition to f′f' at 0. Since f′(0)=0f'(0) = 0⁠, the quotient is f′(h)−0h=3h∣h∣h=3∣h∣\frac{f'(h) - 0}{h} = \frac{3h|h|}{h} = 3|h| for h≠0h \ne 0⁠.

    Left (h<0h < 0⁠):

    lim⁡h→0−3∣h∣=lim⁡h→0−(−3h)=0.\lim_{h\to0^-}3|h| = \lim_{h\to0^-}(-3h) = 0.

    Right (h>0h > 0⁠):

    lim⁡h→0+3∣h∣=lim⁡h→0+3h=0.\lim_{h\to0^+}3|h| = \lim_{h\to0^+}3h = 0.

    Both are 0, so f′f' is differentiable at 0 and f′′(0)=0f''(0) = 0⁠.

    This is the heart of the question. We cannot get f′′(0)f''(0) by plugging x=0x = 0 into "6x6x" or "−6x-6x": those formulas were derived only for x≠0x \ne 0⁠. The definition must be applied to f′f' at the junction, and it confirms that both sides agree.
    Definition of the derivative at a point, applied to f′f' (Basics 2 and 4). Basics: left-hand and right-hand limits
  7. Conclude: f′′(x)=6∣x∣f''(x) = 6|x| for every real xx

    f′′(x)={6x,x>0,0,x=0,−6x,x<0,f''(x) = \begin{cases} 6x, & x > 0, \\ 0, & x = 0, \\ -6x, & x < 0, \end{cases}

    that is, in one formula,

    f′′(x)=6∣x∣for every real x.f''(x) = 6|x| \quad \text{for every real } x.
    −1 1 −4 −2 2 4 6 x y f(x) = |x|³ f′(x) = 3x|x| f′′(x) = 6|x| All three pass through (0, 0). Only f′′ has a corner there.
    f(x)=∣x∣3f(x) = |x|^3 (blue), f′(x)=3x∣x∣f'(x) = 3x|x| (gold) and f′′(x)=6∣x∣f''(x) = 6|x| (green) for −1.25≤x≤1.25-1.25 \le x \le 1.25⁠; horizontal and vertical scales differ. ff and f′f' pass smoothly through the origin; f′′f'' has a corner there, like ∣x∣|x|⁠.
    f′′f'' exists at every real number: Step 5 handles x≠0x \ne 0 and Step 6 handles x=0x = 0⁠. The single formula 6∣x∣6|x| matches all three pieces. Going one step further, f′′=6∣x∣f'' = 6|x| has a corner at 0 (its one-sided difference quotients are −6-6 and 66⁠), so the third derivative of ∣x∣3|x|^3 does not exist at 0. Each differentiation costs one order of smoothness: ff can be differentiated twice at 0, f′f' once, f′′f'' not at all.
    Same corner as ∣x∣|x| at 0 (discussion after Theorem 3, Section 5.3). Lesson: differentiability
Result

f′′(x)f''(x) exists for every real xx⁠, and

f′(x)=3x∣x∣,f′′(x)=6∣x∣,f'(x) = 3x|x|, \qquad f''(x) = 6|x|,

that is, f′′(x)=6xf''(x) = 6x for x≥0x \ge 0 and f′′(x)=−6xf''(x) = -6x for x<0x < 0⁠.

In particular f′(0)=f′′(0)=0f'(0) = f''(0) = 0⁠. (The answer key gives no answer for this question.)

Check it with numbers

Difference quotients at 0 with h=±0.01h = \pm 0.01⁠: f(h)−f(0)h=h∣h∣=±0.0001\frac{f(h) - f(0)}{h} = h|h| = \pm 0.0001 (both tending to 0), and f′(h)−f′(0)h=3∣h∣=0.03\frac{f'(h) - f'(0)}{h} = 3|h| = 0.03 on both sides (tending to 0). ✓

Away from 0: f′(0.5)=3(0.5)2=0.75f'(0.5) = 3(0.5)^2 = 0.75 and f′(−0.5)=−0.75f'(-0.5) = -0.75⁠; f′′(0.5)=3f''(0.5) = 3 and f′′(−0.5)=3=6∣−0.5∣f''(-0.5) = 3 = 6|-0.5|⁠. ✓

Common mistakes
  1. Writing f′′(x)=6xf''(x) = 6x everywhere. For x<0x < 0 it is −6x-6x⁠; the answer must be 6∣x∣6|x|⁠.
  2. Finding f′(0)f'(0) or f′′(0)f''(0) by substituting 0 into a piece's formula. At a junction only the one-sided difference quotients decide.
  3. Forgetting that f′′(0)f''(0) needs f′(0)f'(0) first: the quotient f′(h)−f′(0)h\frac{f'(h) - f'(0)}{h} uses the value f′(0)=0f'(0) = 0 from Step 3.
What to take away
  1. At a junction of a piecewise function, compute derivatives from the definition, separately from the left and from the right.
  2. ∣x∣|x| has a corner at 0, ∣x∣2=x2|x|^2 = x^2 is smooth, and ∣x∣3|x|^3 has two derivatives at 0 but not a third.

Every fact used, and where it comes from

FactUsed inSource
∣x∣=x|x| = x or −x-xSteps 1, 4, 7Definition of absolute value
Differentiable at cc⁠: one-sided limits of the difference quotient finite and equalSteps 3, 6Section 5.3 (Lesson: differentiability)
Power ruleSteps 2, 5Table 5.3, Section 5.3
Second order derivativeSteps 5–7Section 5.7 (Lesson: second order derivative)
∣x∣|x| is not differentiable at 0Steps 3, 7Discussion after Theorem 3, Section 5.3
Numerical values, figure coordinatesCheck, figureRecomputed in the site's verification script
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 →