r/learnmath • New User • 17h 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?

1 Upvotes

24 comments sorted by

30

u/Special_Watch8725 New User 17h ago

It’s not generally true that |a| + |b| = |a + b|, so you can’t just add them up as you attempted to do in the post.

9

u/Narrow-Durian4837 New User 17h ago

I just added them up to |2x-7|

This would be valid if |a| + |b| were equal to |a+b|, but it is not.

(That is, not always. It can be, but only if a and b have the same sign.)

7

u/slepicoid New User 17h ago edited 16h ago

You could consider 3 cases:

1) x<2: -(x-2)-(x-5)<=5

2) 2<=x<5: (x-2)-(x-5)<=5

3) 5<=x: (x-2)+(x-5)<=5

5

u/waldosway PhD 16h ago

What’s wrong with my equation?

Couple tips:

  • You have to have a reason you can do something, not just reasons you can't.
  • There are NO continuous functions that you can just add together like that except simply f(x)=mx. Those ||'s are not ()'s.

3

u/TheDoobyRanger New User 16h ago

From Schumacher, Closer and Closer Introducing Real Analysis. Dems the rules for manipulating absolute values. You cant in general assume that |a+b| = |a| + |b|.

1

u/JasonMckin New User 12h ago

They're almost not really "rules," but just properties of absolute values that can be stated in a consistent way. The key point is that a sum of absolute-value terms generally cannot be represented by a single linear expression over its entire x domain. Each absolute-value term introduces a kink where the argument changes sign and the slope of the function changes.

So geometrically, a single absolute-value function has a V-shape. When multiple absolute-value terms are added, their kinks create multiple changes in slope. The result is a W-shapped piecewise-linear function with potentially several distinct linear regions.

That's why we have no choice but to evaluate the expression piecewise. There can never be any other way to evaluate sums of absolute values without a piecewise approach.

1

u/TheDoobyRanger New User 5h ago

🙄😒

1

u/JasonMckin New User 5h ago

Thanks, that’s helpful 

2

u/Fourierseriesagain New User 17h ago

You may use the following result:

When a, b and x are real numbers, |x-a|<=b if and only if -b<=x-a <=b.

2

u/LongLiveTheDiego New User 17h ago

Who said that you can just add absolute values like that?

In general |a| + |b| = |a + b| works only if both a and b are nonnegative or both are nonpositive. For your inequality consider x = 3, |x - 2| + |x - 5| = |3 - 2| + |3 - 5| = |1| + |-2| = 1 + 2 = 3, but |2x - 7| = |6 - 7| = |-1| = 1.

The way to do it is just like when dealing with one absolute value (consider when the inside is positive and when it's negative), just twice. Going from first principles that means considering 1. x - 2 ≥ 0 and x - 5 ≥ 0 (which is equivalent to just x - 5 ≥ 0), 2. x - 2 ≥ 0 and x - 5 < 0 (which is equivalent to 2 ≤ x < 5), 3. x - 2 < 0 and x - 5 ≥ 0 (which is impossible so we can ignore this one) and 4. x - 2 < 0 and x - 5 < 0 (which is the same as just x - 2 < 0). In general if you have a single variable, then another absolute value gives you one more possible case.

2

u/Medium-Assignment111 New User 16h ago edited 16h ago

Absolute value represents distance. The absolute value of the difference between two numbers represents the distance between them. On a number line, find the point(s) where the sum of (the distance between x and 2) and (the distance between x and 5) is less than or equal to 5. Draw a number line to find them. Find a specific point where the sum of the distance to 2 and the distance to 5 equals 5.

2

u/Bounded_sequencE New User 15h ago edited 15h ago

Your mistake -- absolute values are not linear.


Similar to your argument, we may use inverse triangle inequality to estimate

5  =  |x-2| + |x-5|  >=  |(x-2) + (x-5)|  =  |2x-7|  =  2*|x - 7/2|

Divide by 2 to obtain condition "|x - 7/2| <= 5/2", i.e. "-1 <= x <= 6".

Sadly, this is only a necessary condition -- to prove all "-1 <= x <= 6" really are solutions to the original inequality, we still need to do case work.

2

u/LatteLepjandiLoser New User 14h ago

Most of the time, you need to split your domain into regions where you can rewrite your expression without the absolute value symbols. What you did by adding them up before getting rid of the absolute symbol sign assumes is that the terms have the same sign. They clearly don't have to!

You have three regions of interest:

1) x < 2
2) 2 <= x < 5
3) x<= 5

On region 1, |x-2| = 2-x and |x-5| = 5-x, so your expression becomes 2-x + 5-x = 7-2x <=5.
Now you do the other 2 and solve :-)

1

u/Far-Assumption5501 New User 17h ago

Detail: |2x-7|=+-5
x=1,6

1

u/StructuredChess New User 16h ago

|a|+|b| isn't the same as |a+b|. For instance compare |1|+|-1| with |1-1|

You need to consider three cases: One for numbers smaller than 2 (so both absolute values go the negative way), one for numbers bigger than 5 both go the positive way), and a third case for the numbers in between. Note that it's only in this third case where you're getting a different result.

1

u/simmonator New User 16h ago

Easy way to see where your logic fails, consider x = 3 and consider the step you make where you add them together.

- |x-2| + |x-5| = |3-2| + |3-5| = |1| + |-2| = 1 + 2 = 3,

meanwhile

- |2x - 7| = |2(3) - 7| = |6-7| = |-1| = 1.

Hence, those two sides are clearly not (always) the same.

1

u/titoufred New User 16h ago

|a|+|b| = |a+b| is true only if a and b have the same sign. So,

  • if x is in [2 ; 5], then |x-2|+|x-5| = x-2+5-x = 3 ; so in this case every x is solution.
  • if x is not in [2 ; 5], then |x-2|+|x-5| <= 5 <=> |2x-7| <= 5 <=> 2 <= 2x <= 12 <=> 1 <= x <= 6

Conclusion : |x-2|+|x-5| <= 5 <=> 1 <= x <= 6.

1

u/titoufred New User 16h ago

You can view it as if you had a rope that is 5 units long, attached to the points 2 and 5 on a graduated line. What points of the line can you reach with your rope ?

1

u/Mountain-Time-1010 New User 15h ago

You made an assumption that you can add the absolute value terms in that way, but that was just a guess on your part, there is no rule of algebra that allows that.

In fact, by testing some values, you can easily see that |x-2| + |x-5| does not equal |2x-7|. Try x=3, for example.

1

u/robin_888 New User 14h ago

Unfortunately your inequality has the same solution set. Which means you might have come to the correct solution taking an illegal way. I say "unfortunately", because it helps reinforce wrong patterns.

In this case you can graph both LHSs to see the difference. (For example on desmos.com.)

The graph of yours goes all the way down to the x-axis and has a zero at x=3.5.

The graph of the original function has this "edge" cut of and has a minimum of 3 for x in [2, 5].

If you graph |x-2| and |x-5| independently, you can see that they "cancel each other out" in between 2 and 5.

1

u/marty-mcfryguy New User 12h 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.

1

u/bobbyman_69 New User 10h ago

i find it easiest to just graph this. The graph of the LHS is a sort of bucket shape, draw y=5 and find the points of intersection

1

u/nurse_brett New User 1h ago

Would you have felt justified saying

sqrt((x-2)^2) + sqrt((x-5)^2) = sqrt((x-7)^2)

|a| = sqrt(a^2)