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.
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.