Which Value of x Minimizes the Absolute Function in 0<=x<=4?

cateater2000
Messages
35
Reaction score
0
For which value of x in 0<=x<=4 is the function|x| + 3|x-1| + |x-3|+2|x-4| minimized. I don't know how to differentiate, this and I'm not sure how to draw the graph, any tips would be great.
 
Physics news on Phys.org
Note that your function consists of linear segments, with vertices at x=0,1,3,4
Therefore find the minimum value of these 4 points
 
in general, you take the derivative, set it equal to zero and solve for the unknown then plug that into the original equation. depending on the type of equation you will have a relative or absolute min or max.

why are you trying to solve a minimization without differentiation? are you in pre calc and working with guess and check?
 
That approach only works for differentiable functions. :-p
 
Although you can differentiate it in general it won't be possible at its minimum points.

However it's not a particularly complex function and just involves integers, so just work out x = 0, 1, 2, 3, 4 and that should give you your answer.
 
modmans2ndcoming obviously I'd differentiate it if I knew how to. Thanks for your help to the rest of you.
 
Zurtex said:
Although you can differentiate it in general it won't be possible at its minimum points.

Which is fine, to max/minimize the "calculus way" you look at the critical points, which includes all the points where the derivative does not exist.


cateater2000, you should be able to break this up into a piecewise defined function, if only to convince yourself it is linear in between the integers 0, 1, 3, 4, as arildno mentioned (this will also aid in graphing). You can then differentiate it as usual (with special care at the break points).

f(x)=|x| + 3|x-1| + |x-3|+2|x-4|

when 0<=x<1, all the arguments inside the absolute values are negative except the first, so
f(x)=(x)+3(-(x-1))-(x-3)+2(-(x-4))=-5x+8

when 1<=x<3, the first two arguments are positive, the second two are negative, so
f(x)=(x)+3(x-1)-(x-3)+2(-(x-4))=x+2

You can do the interval 3<=x<=4.

You can now differentiate this guy, and get a piecewise defined function as it's derivative. When 0<x<1, f'(x)=-5, and so on. Note that the derivative is not defined at x=1, or 3 (why?).


I'd strongly suggest you finish what I've started in converting this to a piecewise defined function and draw the graph to give you an idea of how this thing behaves.
 
Wait a minute can you put all that in TeX I did not understand.
 
Sure, not much will change though, the end piecewise defined function will look neater.

We're concerned with the function f(x)=|x|+3|x-1|+|x-3|+2|x-4| on the interval [0,4]. We have to break it up at the points where one of the arguments of an absolute value changes sign, namely x=1 and x=3. 0 and 4 won't matter for this since they are at the endpoints of our domain.

When 0\leq x&lt;1, x is non-negative, so |x|=x. On this same interval, x-1, x-3, x-4 are all negative, so |x-1|=-(x-1)=1-x,|x-3|=-(x-3)=3-x,|x-4|=-(x-4)=4-x. We can use this to determine:

f(x)=x+3(1-x)+3-x+2(4-x)=-5x+14 on the interval 0\leq x &lt;1

which may be why you didn't understand, I apparently can't add, sorry. You do a similar analysis on the other intervals, and (hopefully) find

f(x)=\begin{cases}-5x+14&amp; if\ 0\leq x &lt;1,\\x+8&amp; if\ 1 \leq x &lt;3,\\ 3x+2&amp; if\ 3\leq x\leq 4\end{cases}

You can now differentiate this guy and quickly see

f&#039;(x)=\begin{cases}-5&amp; if\ 0&lt; x &lt;1,\\1&amp; if\ 1 &lt; x &lt;3,\\ 3&amp; if\ 3&lt; x&lt;4\end{cases}

You should be able to see it's not differentiable at 1 and 3.
 
  • #10
Oooh there we go thank you very much.
 

Similar threads

Back
Top