how to solve derivative of a function including two absolute functions

56 Views Asked by At

So I don't understand how to solve the derivative of a function with two absolute functions.

$$f(x) = |x - 1| + |x^2 - 2x|.$$

Here is the function. I need to solve the maximum and minimum values in the domain $[0,2]$ but can't figure out the derivative.

1

There are 1 best solutions below

0
On

If you want to solve by derivative, one way is to break it into smaller domains where signs remain the same.

For $0 \le x \le 1$, $f(x) = -(x-1) - (x^2-2x) = 1+x-x^2$

For $1 \le x \le 2$, $f(x) = (x-1) - (x^2-2x) = 3x-x^2-1$

Now when you differentiate, you get max of $f(x) = \frac{5}{4}$, at $x = \frac{1}{2}$ and $x = \frac{3}{2}$.