Finding the number of solutions for $\left|x\right|+\left|x-3\right|=3$

52 Views Asked by At

$$\left|x\right|+\left|x-3\right|=3$$

Couple of ways to solve this. One way is to square both sides and then continue. Another way is to consider the function as a piece-wise function

$$2x-3=3 \text{ or x = 3,} \text{ when x > 3}$$ $$x-x+3=3 \text{ or 3 = 3,} \text{ when 0 < x < 3}$$ $$-x-x+3=3 \text{ or x = 0,} \text{ when x < 0}$$

So I got $2$ solutions like this, $x= 0$ and $3$ but $x=2$ is also a solution. So why is this method wrong

4

There are 4 best solutions below

2
On

In the second interval, the LHS is always equal to RHS which means $f(x)=3$ for all values of $0<x<3$ which means all values in that interval is a solution of this.


I am making an answer cause I just found the reason‍♂️

0
On

Another take on the solution:
$$|x|+|x-3|=3$$ $$|x|+|3-x|=3=|x+(3-x)|$$ Now, note that $|a|+|b|=|a+b|$ iff $ab\geq0$ (This is the case of equality in the triangle inequality ). Thus we get, x must satisfy $$x(3-x)\geq0$$ which implies that $x \in [0,3]$.

1
On

I think that piece-wise analysis of the function is the way to go. However, you made a fundamental error in your posting.

When you have an expression like $|f(x)| = g(x)$, you need to examine the following cases:

  • $0 \leq f(x) ~\color{red}{\text{rather than} ~0 < f(x)}.$

  • $0 > f(x)$.

0
On

I like @Ted Shifrin's comment in the first answer below. To elaborate on it a bit, since $|x|=|x-0|=$(distance between $x$ and $0$), the expression you started with and your piecewise function both give $f(x)=|x|+|x-3|=$(distance between $x$ and $0$) + (distance between $x$ and $3$). If you think about this geometrically, the sum of these distances will always be greater than or equal to 3, with equality only when $0\leq x \leq 3$.

Here is a Desmos graph of $f(x)$.. It shows that all real numbers between 0 and 3 (including 0 and 3, all the fractions, . . .) are solutions to this equation (not just integers).

Algebraically, this is what your 2nd line is saying. $3=3$ here means "true" or "the equation you started with is true" as long as $0 < x < 3$. Your 1st line says that when $3 \leq x$ the equation you started with is true as long as $x=3$. Similarly, your 3rd line says that when $x \leq 0$ the equation you started with is true as long as $x=0$.