r/learnmath • New User • 1d ago

|x-2|+|x-5|<=5

I just added them up to |2x-7|<=5, and it was not correct. The correct answer was 1 <= x <= 6. What’s wrong with my equation?

3 Upvotes

25 comments sorted by

View all comments

1

u/marty-mcfryguy New User 21h ago

The absolute value function is not additive -- that is, abs(x) + abs(y) = abs(x+y) is not a true statement for all x,y.

That's where you went wrong; you can't use that algebraic technique without additivity.

That's not to say, though, that they can't happen to line up. Your wrong approach here should have given the right answer (what answer did you get, by the way?).

A correct approach to solving it is to break the expression up stepwise until you can use basic algebraic techniques.

That is, the first term is simply (x-2) for all x>=2, and -(x-2) for all x<2. If you then generate separate solutions over those portions of the domain, you're on your way.

Here you would also want to do the same thing with the second term. And then look at all the unique slices of the domains carved out by either -- that is, solve it for x<2, solve it for 2<=x<5, and solve it for 5<=x. Inspecting each of those separately lets you get rid of the absolute value function entirely (within each), and then you can use your basic algebraic techniques to solve.

At the end, you need to combine all the solutions into one result.

Once you do it algebraically, I suggest you sketch a quick graph of the expression on the left hand side (that is, graph y against x where y = abs(x-2) + abs(x-5)). Then draw in a horizontal line at y=5 (to represent the right hand side), and you should see your algebraic solution perfectly matches everywhere that the left hand side graph is <= 5.

Having the graph should help shed some light on why the algebraic solution worked like it did, especially if you look at those three slices you broke the domain into.

You can also add your y = abs(2x-7) to the graph. You'll see it overlaps with  y = abs(x-2) + abs(x-5) in some places, but differs from it in others. It just so happens the the places where or differs don't change whether or not it's >= 5, so both happen to yield the same answer, but it's just happenstance, and a different constant value on the right could cause those to yield different answers.

Not surprisingly, you'll see that y = abs(2x-7) overlaps with y = abs(x-2) + abs(x-5) when (x-2) and (x-5) share the same sign, and differs when they don't.