SOLUTION: Consider the function f(x)= |x-1|+|x-2| Show that f(x)= -2x+3, if x &#8804; 1 1 if 1 < x < 2 2x-3 if x &#8805; 2

Algebra ->  Functions -> SOLUTION: Consider the function f(x)= |x-1|+|x-2| Show that f(x)= -2x+3, if x &#8804; 1 1 if 1 < x < 2 2x-3 if x &#8805; 2      Log On


   



Question 1087149: Consider the function f(x)= |x-1|+|x-2|
Show that f(x)= -2x+3, if x ≤ 1
1 if 1 < x < 2
2x-3 if x ≥ 2

Answer by jim_thompson5910(35256) About Me  (Show Source):
You can put this solution on YOUR website!
Given function: f%28x%29+=+abs%28x-1%29%2Babs%28x-2%29
Let g%28x%29+=+abs%28x-1%29 and h%28x%29+=+abs%28x-2%29
That means f%28x%29+=+g%28x%29%2Bh%28x%29

We can write the absolute value functions, g(x) and h(x), into piecewise function form
For g(x) we have

which basically says g%28x%29+=+-%28x-1%29 if x+%3C=+1 OR g%28x%29+=+x-1 if x+%3E+1
and for h(x) we have

which basically says h%28x%29+=+-%28x-2%29 if x+%3C=+2 OR h%28x%29+=+x-2 if x+%3E+2

We have three intervals
Interval A: the interval where x+%3C=+1
Interval B: the interval where +1+%3C+x+%3C+2
Interval C: the interval where x+%3E=+2

Focus on interval A. Since x+%3C=+1 here this means that g%28x%29+=+-%28x-1%29 and h%28x%29=-%28x-2%29
Therefore, f%28x%29+=+g%28x%29%2Bh%28x%29=-%28x-1%29%2B%28-%28x-2%29%29=-x%2B1-x%2B2=-2x%2B3 when +x+%3C=+1
In short, f%28x%29=-2x%2B3 when +x+%3C=+1

Now move onto interval B. We have +1+%3C+x+%3C+2. This interval will have us use g(x) = x-1 and h(x) = -(x-2). Add the functions to get
f%28x%29+=+g%28x%29%2Bh%28x%29=x-1%2B%28-%28x-2%29%29=x-1-x%2B2=1 when +1+%3C+x+%3C+2
In short, f%28x%29=1 when +1+%3C+x+%3C+2

Finally interval C. Now x+%3E=+2. For this interval g%28x%29=x-1 and h%28x%29=x-2
So, f%28x%29+=+g%28x%29%2Bh%28x%29=x-1%2Bx-2=2x-3 when +x+%3E=+2
In short, f%28x%29=2x-3 when +x+%3E=+2

To recap, we found the following
f%28x%29=-2x%2B3 when +x+%3C=+1
f%28x%29=1 when +1+%3C+x+%3C+2
f%28x%29=2x-3 when +x+%3E=+2
Which can be combined to form the piecewise function

So this proves that overall, f%28x%29+=+k%28x%29 for all real numbers x

As visual confirmation, here is a graph showing a side by side comparision of f(x) and k(x). I let f(x) = |x-1|+|x-2| while k(x) is the piecewise function equivalent form. The two function curves are blue and brown respectively. As you can see, they are identical. If you laid them on the same xy coordinate system then you'd have the same graph. One function curve would overlap the other perfectly.
Note: The graph was created with GeoGebra (free graphing software).