# find the min and max value from absolute function?

Tags:
1. Jul 4, 2017

### Helly123

1. The problem statement, all variables and given/known data

2. Relevant equations
f ' (x) = 0 -> to find extreme point

3. The attempt at a solution
can I differentiate the function directly?
f ' (x) = |1| + | 2x - 2|
0 = 2x - 1
x = 1/2
and x from domain = { 0, 2 }

the range we get :
f(0) = 1
f(2) = 1
f(1/2) = 1/2 + 3/4 = 5/4

min = 1
max = 5/4

2. Jul 4, 2017

### SammyS

Staff Emeritus
That is not the correct derivative.

It may be helpful to graph each of the following:
$y=\left \vert x-1 \right \vert$
$y=\left \vert x^2-2x \right \vert$​

Furthermore:
There are more conditions for which you may have a minimum or maximum. What are the more general conditions?

3. Jul 4, 2017

### mjc123

The answers are right, but the method is not. If f = |x-1|, f' is not |1|, as you can see by drawing the curve.
Let's simplify by noting that in the range 0-2, x2-2x is always negative, so |x2-2x| is 2x-x2
For |x-1|, consider the ranges 0-1 and 1-2 separately. (x=1/2 is not the only maximum.)

4. Jul 4, 2017

### Buffu

Turn it into a composite function of three elementary functions, then do the derivative trick.

5. Jul 4, 2017

### Helly123

$f(x) = | x-1 | + | x^2 -2x |$
f(x) = |x-1 |> 0
x > 1
For domain 0,2
Means for 0<= x < 1
x-1 negative
| x-1| = - (x-1) = 1-x

For 1<= x < = 2
x-1 positive

$f(x) = | x^2 - 2x |$
$f(x) = x^2 - 2x > 0$
x > 2

Means for domain {0,2}
0<= x <= 2
$f(x) = x^2 - 2x negative$
$f(x) = | x^2 - 2x | = -(x^2 -2x) = 2x - x^2$

For
0<= x < 1
$F(x) = 1-x + 2x - x^2$
Extreme point = -b/2a = 1/2, x = 1/2
For 1<= x <= 2
$F(x) = x - 1 + 2x - x^2$
Extreme point = -b/2a = 3/2, x = 3/2

Check for x = 0, x = 2, x = 1/2 , x = 3/2
F(0) = 1
F(1/2) = 3/2 - 1/4 = 5/4
F(2) = 1
F(3/2) = 1/2 + 3 - 9/4 = 2/4 + 12/4 - 9/4 = 5/4

Max = 5/4
Min = 1

6. Jul 5, 2017

### SammyS

Staff Emeritus
There may also be a min/max where the derivative is undefined.

Last edited: Jul 5, 2017
7. Jul 6, 2017

### Helly123

what exactly is that?

8. Jul 6, 2017

### SammyS

Staff Emeritus
In your Opening Post, you stated:
It's also true that you may find an extreme point where the derivative, f ' (x), is undefined.

9. Jul 6, 2017

### Staff: Mentor

For example, g(x) = |x|.
g'(x) > 0 if x > 0, and g'(x) < 0 if x < 0.
This function has a minimum even though there is no point at which its derivative is zero.

10. Jul 7, 2017

### Helly123

How to find max and min without differentiation ?

11. Jul 7, 2017

### Helly123

What do you meant "3" elementary functions? Aren't there only 2 ?

12. Jul 7, 2017

### Helly123

To get rid of the absolute , we must add min if the function negative, and must add + if the function positive?

13. Jul 7, 2017

### Ray Vickson

No: banish forever from your mind the requirement that $f'(x) = 0$ for a max or a min on a finite interval $[a,b]$, as it is just not true. The correct statement is that "If differentiable $f(\cdot)$ has a maximum or a minimum at an interior point $a < x < b$ then $f'(x) = 0$." The derivative may not be zero at an end-point max or min. For example, the function $f(x) = x$ on the interval $[0,1]$ has minimum at $x = 0$ and a maximum at $x = 1$, but the derivative does not vanish at either of those two points (or, for that matter, at any point $x$).

14. Jul 8, 2017

### Buffu

Why do you think there are only two ?

15. Jul 8, 2017

### Helly123

Only |x -1| and |x^2 -2x| ?

16. Jul 9, 2017

### Staff: Mentor

It's not obvious to me that f(x) = |x| + |x2 - 2x| can be viewed as the composition of three elementary functions. I think I get what you're hinting at, but a better word choice would be sum, rather than composition, which implies function composition.

In any case, this thread is posted in the Precalc section and the OP later asks how to answer the question without using derivatives. It's not clear what techniques should be used, though, as the OP started off by talking about derivatives.

@Helly123, this problem does not require the use of calculus. Sketch the graph of y = |x - 1|+ |x2 - 2x|. This graph will have two formulas on the interval [0, 2]. It's possible to find the max. and min. values for each of these forumulas without the use of calculus.

17. Jul 10, 2017

### Buffu

Consider your function between $(-\infty, 0], (0, 1], (1,2]$ and $(2, \infty)$.

18. Jul 10, 2017

### Ray Vickson

The question specified the domain $[0,2]$.