How would one go about solving (for $x$) an equation which looks like $$ \left| \frac{x - k}k \right| + \left| \frac{x - c}k \right| = m$$ for constants $k$, $c$, $m$?
Solving equations with two terms having absolute values
-
0are the constants positive? – 2017-02-26
2 Answers
First we can re-write this as $|x-k| + |x-c| = m|k|$. Now assuming $k>c$ we consider cases:
- $x > k > c$ gives $x-k + x-c = m|k| \Rightarrow x = \frac{1}{2}(m|k| + k + c)$
- $c < x < k$ gives $-x+k + x - c = m|k|$ which has no solution unless $k-c = m|k|$ in which any $x \in [c,k]$ is a solution
- $x < c< k$ gives $-x+k -x+c = m|k| \Rightarrow x = -\frac{1}{2}(m|k| -k-c)$
- $x=k$ gives $x-c = m|k| \Rightarrow x = m|k| + c$
- $x=c$ gives $-x+k = m|k| \Rightarrow x = k - m|k|$.
You can repeat the same technique with $k
Let $x=ku$ and $r=c/k$. The equation becomes
$$|u-1|+|u-r|=m$$
If $|1-r|\gt m$, there are no solutions possible. If $|1-r|\lt m$, there are two solutions: one with $u$ to the right of both $1$ and $r$, and one with $u$ to the left of both, i.e.,
$$u= \begin{cases} \max(1,r)+\displaystyle{m-|1-r|\over2}\\\\ \min(1,r)-\displaystyle{m-|1-r|\over2} \end{cases}$$
Finally, if $|1-r|=m$, then all $u$ between $1$ and $r$ are solutions.
The key to seeing all this is to simply plot the points $1$ and $r$ on the number line and then interpret $|u-1|$ and $|u-r|$ as the distance from the point $u$ to the points $1$ and $r$, respectively.