Absolute equation to find the max and min point

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
12 replies · 2K views
Lifeforbetter
Messages
48
Reaction score
1
Homework Statement
|x -1| + |$x^2 $ - 2x|
Domain (0, 2)
Find the max and min point
Relevant Equations
F'(x) = 0
To find max and min point
X-1 > 0
x>1

$x^2$ - 2x >0
X>2

For 0<x<1
f(x) = -x +1 + -$x^2 $ +2x

For 1<x<2
f(x) = x -1 - $x^2 $ + 2x

Find each of the equation the critical point
By using f'(x) = 0
And decide which is max and min

I get x = 1/2 and x = 3/2
But it's wrong
Why?
 
Physics news on Phys.org
This is what wolframalpha has to say on the matter.
246001

On a pedantic note, fix your cases such that [itex]x=1[/itex] is considered in one of them (depends on which way you define absolute value).

You get two candidates for local extrema. Now check which kind they are, whether by definition or by the second derivative trick. What's the story with [itex]x=1[/itex]?

As a reminder: if there is a local extremum at point [itex]a[/itex], then the derivative at that point is zero or the function is not differentiable at [itex]a[/itex] (in other words, the point [itex]a[/itex] is a critical point).

There is no equivalence, however. For [itex]x=1[/itex] there is no differentiability, so you will have to check by definition, whether it is a local extremum point.
 
Last edited:
The problem is to find maxima and minima for y= |x- 1|+ |x^2- 2x|= |x-1|+ |x(x- 2)|.

The first thing I would do is recognize that the absolute values are 0 for x= 1, x= 0, and x= 2. So I would divide the real line into four intervals: x< 0, 0< x< 1, 1< x< 2, and x> 2.

If x< 0 then all of x- 1, x, and x- 2 are negative. The product of x and x-2 however is positive so y= -(x- 1)+ x(x- 2)= -x+ 1+ x^2- 2x= x^2- 3x+ 1. y'= 2x- 3 which is 0 when x= 3/2. But that is not less than 0. y has no critical point when x< 0.

If 0< x< 1 then x is positive but x- 1 and x- 2 are negative. The product of x and x- 2 is negative so y= -(x-1)- x(x- 2)= -x+ 1- x^2+ 2x= -x^2+ x+ 1. y'= -2x+ 1 which is 0 when x= 1/2. Yes, that is between 0 and 1 so x= 1/2, y= -1/4+ 1/2+ 1= 5/4, is a critical point.

If 1< x< 2 then both x and x- 1 are positive but x- 2 is negative. The product of x and x- 2 is negative so y= x- 1- x(x- 2)= x- 1- x^2+ 2x= -x^2+ x- 1. y'= -2x+ 1 as before. That is 0 when x= 1/2 which is not between 1 and 2. There is no critical point between 1 and 2.

If x> 2 then all three of x, x- 1, and x- 2 are positive. So y= x- 1+ x(x- 2)= x- 1+ x^2- 2x= x^2- x- 1. y'= 2x- 1 which is 0 when x= 1/2. That is not larger than 2 so there is not critical point for x> 2.

The only critical point is x= 1/2, where y= 5/4 but we also need to check x= 0, x= 1, and x= 2. When x= 0, y= |0- 1|+ |0- 0|= |-1|= 1. When x= 1, y= |1- 1|+ |1- 2|= |-1|= 1. When x= 2, y= |2- 1|+ |4- 4|= |1|= 1.

The maximum value for the function is 5/4 which happens when x= 1/2. The minimum value is 1 which happens at x= 0, 1, and 2.
 
  • Like
Likes   Reactions: Lifeforbetter
HallsofIvy said:
;..

If 1< x< 2 then both x and x- 1 are positive but x- 2 is negative. The product of x and x- 2 is negative so y= x- 1- x(x- 2)= x- 1- x^2+ 2x= -x^2+ x- 1. y'= -2x+ 1 as before. That is 0 when x= 1/2 which is not between 1 and 2. There is no critical point between 1 and 2.
,,,
You have an error in the 1 < x < 2 case.
Should be ## y=-x^2+3x-1 ##
 
  • Like
Likes   Reactions: Lifeforbetter and HallsofIvy
HallsofIvy said:
The problem is to find maxima and minima for y= |x- 1|+ |x^2- 2x|= |x-1|+ |x(x- 2)|.

The first thing I would do is recognize that the absolute values are 0 for x= 1, x= 0, and x= 2. So I would divide the real line into four intervals: x< 0, 0< x< 1, 1< x< 2, and x> 2.

If x< 0 then all of x- 1, x, and x- 2 are negative. The product of x and x-2 however is positive so y= -(x- 1)+ x(x- 2)= -x+ 1+ x^2- 2x= x^2- 3x+ 1. y'= 2x- 3 which is 0 when x= 3/2. But that is not less than 0. y has no critical point when x< 0.

If 0< x< 1 then x is positive but x- 1 and x- 2 are negative. The product of x and x- 2 is negative so y= -(x-1)- x(x- 2)= -x+ 1- x^2+ 2x= -x^2+ x+ 1. y'= -2x+ 1 which is 0 when x= 1/2. Yes, that is between 0 and 1 so x= 1/2, y= -1/4+ 1/2+ 1= 5/4, is a critical point.

If 1< x< 2 then both x and x- 1 are positive but x- 2 is negative. The product of x and x- 2 is negative so y= x- 1- x(x- 2)= x- 1- x^2+ 2x= -x^2+ x- 1. y'= -2x+ 1 as before. That is 0 when x= 1/2 which is not between 1 and 2. There is no critical point between 1 and 2.

If x> 2 then all three of x, x- 1, and x- 2 are positive. So y= x- 1+ x(x- 2)= x- 1+ x^2- 2x= x^2- x- 1. y'= 2x- 1 which is 0 when x= 1/2. That is not larger than 2 so there is not critical point for x> 2.

The only critical point is x= 1/2, where y= 5/4 but we also need to check x= 0, x= 1, and x= 2. When x= 0, y= |0- 1|+ |0- 0|= |-1|= 1. When x= 1, y= |1- 1|+ |1- 2|= |-1|= 1. When x= 2, y= |2- 1|+ |4- 4|= |1|= 1.

The maximum value for the function is 5/4 which happens when x= 1/2. The minimum value is 1 which happens at x= 0, 1, and 2.
Why 0 1 2 of interval included in the domain?
 
I would say before any calculations I would do a sketch. In any old-fashioned school I think the teacher would do this in class. Graphing with devices most people have nowadays makes it less tedious too.
563F435D-33D6-4AC3-B804-497B1BDB3AFD.png
563F435D-33D6-4AC3-B804-497B1BDB3AFD.png
 
  • Like
Likes   Reactions: Lifeforbetter and Merlin3189
epenguin said:
I would say before any calculations I would do a sketch. In any old-fashioned school I think the teacher would do this in class. Graphing with devices most people have nowadays makes it less tedious too.

{Graph}
Just to note: @nuuskur had a graph from WolframAlpha in his Post (#2), but the penguin's graphs show how the overall graph emerges from its basic parts.
 
  • Like
Likes   Reactions: epenguin
SammyS said:
Just to note: @nuuskur had a graph from WolframAlpha in his Post (#2), but the penguin's graphs show how the overall graph emerges from its basic parts.
Thank you, because it was behind a spoiler I hadn't noticed. I must also remember this device which I have never used I think.
 
epenguin said:
Thank you, because it was behind a spoiler I hadn't noticed. I must also remember this device which I have never used I think.
Yes.
I seldom use it either.

I suppose it's useful at times, but in this case it did more to "spoil" than to help. :wink:
 
I still get the same maxima as Lifeforbetter's first post. Has anyone said yet why or how that is wrong?
Lifeforbetter said:
I get x = 1/2 and x = 3/2
But it's wrong
Why?
 
Merlin3189 said:
I still get the same maxima as Lifeforbetter's first post. Has anyone said yet why or how that is wrong?
That's it the critical points x. But the question asked for value which is y
 
Lifeforbetter said:
That's it the critical points x. But the question asked for value which is y
Just evaluate f at those critical numbers, with ##f(x) = |x -1| + |x^2 - 2x|##. How hard is that?
If x = 1/2 is a critical number, then (1/2, f(1/2)) is a critical point, and f(1/2) would be the max. or min. value. The same holds for x = 3/2, assuming that 1/2 and 3/2 are the correct values.
 
  • Like
Likes   Reactions: Lifeforbetter