An equation with a parameter

Given the equation $(|x+1|+|x-a|)^2-2(|x+1|+|x-a|)+4a-4a^2=0$ find all possible $a$ such that this equation has only one solution.

I wanted to solve it like this:

$(|x+1|+|x-a|)^2-2(|x+1|+|x-a|)+4a-4a^2=0 \iff(|x+1|+|x-a|-2a)(|x+1|+|x-a| +2a-2)=0$

Then, since both equations in parentheses have to be equal we need to solve $2a-2=-2a$, which will give $a=\frac{1}{2}$.

Plugging $\frac{1}{2}$ in the equation will give $(|x+1|+|x-\frac{1}{2}|-1)^2=0$ and if we solve this, we won't get a case where we have 1 solution, hence there can't be such an $a$.

Is it a wrong solution? I was told it is, but I don't understand why. Also, the answer is correct.

• You forgot to consider cases, when only one of the parenthesis has solutions. – Kaster May 10 '16 at 21:40
• @Kaster I don't really understand what you mean by that. Do we need to solve each equation in the parentheses separately and then intersect the solutions or together like I did? – Pavel May 10 '16 at 21:43
• It is possible that expression in one of the parenthesis doesn't have a solution, since it involves absolute values. For example, what's the solution of $|x-1| = -2$ ? – Kaster May 10 '16 at 21:46
• @Kaster so what if it doesn't? Then we don't need that case. I don't understand what you mean exactly, sorry, I know that |x-1| can't be -2, but I still don't get your point. – Pavel May 10 '16 at 21:52
• It leaves you with only one of the parenthesis, which also involves absolute values, so that other expression might have one, two or no solutions. So, it's not just making solutions of the expressions in each parenthesis equal. In other words, you need to consider more cases, not just that one case you described in your question. – Kaster May 10 '16 at 21:55

The expression $f(x)=|x+1|+|x-a|$ is symmetric around $2x=a-1$ so that there are always at least two $x$ achieving the same $f(x)$, and solutions always go in pairs (or more; actually the function is flat between $1$ and $a$).

The only way to have a single solution would be when $a=-1$ so that the flat reduces to a single point, but this does not work as $x=-2,-1,0$ are three solutions.

• why |x-1+|x-a|? where did |x-1| come from? – Pavel May 10 '16 at 21:54
• @paulpaul1076: from a typo :) – Yves Daoust May 10 '16 at 21:54

HINT :

$Let : (|x+1| + |x-a|) = y$.

Then your equation becomes : $y^2 - 2y + 4a - 4a^2$.

Solve that and then define the $y$ you find as your starting form $(|x+1| + |x-a|)$ and then find the $a$ that this equation has one solution.

• That's exactly what OP did. – Kaster May 10 '16 at 21:38
• Yea, I've already done that, don't understand your hint – Pavel May 10 '16 at 21:40
• It's missing steps, letting a $y$ parameter be an expression means you must define strictly that $y$ which wasn't done and that's why I say "define the y..". – Rebellos May 10 '16 at 21:40
• Kaster just added a comment to your question (consider cases), that is what I mean by the word "define y". :) – Rebellos May 10 '16 at 21:40