__Example 1:__ Find the first derivative f '(x), if f is given by

**f(x) = |x - 1|**
__Solution to Example 1__

Noting that | u | = √ ( u^{2} ), let u = x - 1 so that f(x) may be written as

f(x) = y = √( u^{2} )

We now use the chain rule

f '(x) = (dy / du) (du / dx)

= (1/2) (2 u) / √ (u^{2}) (du / dx)

= u . u' / | u |

= u . 1 / √ (u^{2}) = (x - 1) / |x - 1|

We note that if x > 1, |x - 1| = x - 1 and f '(x) = 1. If x < 1, |x - 1| = -(x - 1) and f '(x) = -1. f'(x) does not exist at x = 1.

__Example 2:__ Find the first derivative of f given by

**f(x) = - x + 2 + |- x + 2|**
__Solution to Example 2__

f(x) is made up of the sum of two functions. Let u = - x + 2 so that

f'(x) = -1 + u u' / |u| = -1 + (- x + 2)(-1) / |-x + 2|

We note that if x < 2, |- x + 2 | = - x + 2 and f'(x) = -2 . If x > 2, f'(x) = 0. f'(x) does not exist at x = 2.

As an exercise, plot the graph of f and explain the results concerning f'(x) obtained above.

__Exercises:__ Find the first derivatives of these functions

1. f(x) = |2x - 5|

2. f(x) = (x - 2)^{2} + |x - 2|

__Answers to above exercises:__

1. f'(x) = 2 (2x - 5) / |2x - 5|

2. f(x) = 2 (x - 2) + (x - 2) / |x - 2|

More on differentiation and derivatives