# a<b<c<d. How do you find the solution(s) of |x-a|+|x-c|=|x-b|+|x-d|? It is verifiable that, for (a, b, c, d)=(1, 2, 3, 5), x=7/2 is a solution.

Jan 12, 2018

You need case analysis.

#### Explanation:

There are several cases, in the point view of the value of $x$.

[Case1]
If $x < a$, the equation will be

$- \left(x - a\right) - \left(x - c\right) = - \left(x - b\right) - \left(x - d\right)$
$- 2 x + a + c = - 2 x + b + d$
$a + c = b + d$

This result is inconsistent with the fact $a < b < c < d$. So there is no solutions in this case.

[Case2]
If $a \le x < b$,

$\left(x - a\right) - \left(x - c\right) = - \left(x - b\right) - \left(x - d\right)$
$- a + c = - 2 x + b + d$
$2 x = a + b - c + d$
$x = \frac{a + b - c + d}{2}$

For example, if $\left(a , b , c , d\right) = \left(1 , 2 , 3 , 5\right)$, $x = \frac{1 + 2 - 3 + 5}{2} = \frac{5}{2}$.
But this is an inappropriate solution as the result is inconsistent with $1 \le x < 2$.

Then, proceed to the following cases.
[Case3] $b \le x < c$

$\left(x - a\right) - \left(x - c\right) = \left(x - b\right) - \left(x - d\right)$
$- a + c = - b + d$
$a + d = b + c$

If $a + d$ equals to $b + c$, every $x$ that satisfy $b \le x < c$ is the solution. Otherwise, no $x$ in this domain will be the answer.

[Case4] $c \le x < d$

$\left(x - a\right) + \left(x - c\right) = \left(x - b\right) - \left(x - d\right)$
$2 x - a - c = - b + d$
$2 x = a - b + c + d$
$x = \frac{a - b + c + d}{2}$

When $\left(a , b , c , d\right) = \left(1 , 2 , 3 , 5\right)$, the solution is
$x = \frac{1 - 2 + 3 + 5}{2} = \frac{7}{2}$ and this is the appropriate solution.($3 \le \frac{7}{2} < 5$

[Case5] $d \le x$
In this case, there is no solution. The reason is same as [Case1].

Jan 12, 2018

Here is the alternative way(drawing the graph)

#### Explanation:

Let $f \left(x\right) = \left\mid x - a \right\mid + \left\mid x - c \right\mid$.

This can be written as a piecewise function:
$f \left(x\right) = - 2 x + a + c$ $\left(x < a\right)$
$f \left(x\right) = - a + c$ $\left(a \le x < c\right)$
$f \left(x\right) = 2 x - a - c$ $\left(c \le x\right)$

You can write $g \left(x\right) = \left\mid x - b \right\mid + \left\mid x - d \right\mid$ as a piecewise function in the same way.

Then, draw the two graphs: $y = f \left(x\right)$ and $y = g \left(x\right)$.
The graphs below is for $\left(a , b , c , d\right) = \left(1 , 2 , 3 , 5\right)$. You can see that the two graphs crosses at $\left(\frac{7}{2} , 3\right)$.
graph{(abs(x-1)+abs(x-3)-y)(abs(x-2)+abs(x-5)-y)=0 [-6.05, 13.95, -1.64, 8.36]}