Recall the definition of absolute value:
• If <em>x</em> ≥ 0, then |<em>x</em>| = <em>x</em>
• If<em> x</em> < 0, then |<em>x</em>| = -<em>x</em>
<em />
(a) Splitting up <em>f(x)</em> = <em>x</em> |<em>x</em>| into similar cases, you have
• <em>f(x)</em> = <em>x</em> ² if <em>x</em> ≥ 0
• <em>f(x)</em> = -<em>x</em> ² if <em>x</em> < 0
Differentiating <em>f</em>, you get
• <em>f '(x)</em> = 2<em>x</em> if <em>x</em> > 0 (note the strict inequality now)
• <em>f '(x)</em> = -2<em>x</em> if <em>x</em> < 0
To get the derivative at <em>x</em> = 0, notice that <em>f '(x)</em> approaches 0 from either side, so <em>f</em> <em>'(x)</em> = 0 if <em>x</em> = 0.
The derivative exists on its entire domain, so <em>f(x)</em> is differentiable everywhere, i.e. over the interval (-∞, ∞).
(b) Similarly splitting up <em>g(x)</em> = <em>x</em> + |<em>x</em>| gives
• <em>g(x)</em> = 2<em>x</em> if <em>x</em> ≥ 0
• <em>g(x)</em> = 0 if <em>x</em> < 0
Differentiating gives
• <em>g'(x)</em> = 2 if <em>x</em> > 0
• <em>g'(x)</em> = 0 if <em>x</em> < 0
but this time the limits of <em>g'(x)</em> as <em>x</em> approaches 0 from either side do not match (the limit from the left is 0 while the limit from the right is 2), so <em>g(x)</em> is differentiable everywhere <u>except</u> <em>x</em> = 0, i.e. over the interval (-∞, 0) ∪ (0, ∞).