Distinct Roots of $x^2+(a-5)x+1=3|x|$ Problem:

$$x^2+(a-5)x+1=3|x|$$ Find 3 distinct solutions to the above problem.

A friend of mine at my coaching center came up with this problem which nobody was able to solve. Unfortunately, I have been unable to contact my professor and understand how to solve this problem. Despite thinking for a long time, I could not come up with anything.
The only things that struck me was that I should open up the modulus sign (first by taking $x\ge0\Rightarrow |x|=x$ and then by taking $x<0\Rightarrow |x|=-x$). 
Also, the question could perhaps then be tackled by using relations between the roots of the quadratic equations (I know only that the sum of both roots of a quadratic equation $ax^2+bx+c$ is $\dfrac{-b}{a},$ and that their product is $\dfrac{c}{a}$).
Unfortunately I could not proceed any further. I would be truly grateful if somebody would kindly show me how to solve this problem. Many, many thanks in advance!
 A: Case when $x \geq 0$:
$x^2+(a-8)x+1=0$
Then $x=\frac{(8-a)\pm \sqrt{a^2-16a+60}}{2}$
Case when $x < 0$:
$x^2+(a-2)x+1=0$
Then $x=\frac{(2-a)\pm \sqrt{a^2-4a}}{2}$
As we're only working with real solutions: for the determinants to be non-negative, we need $a \leq 6$ or $a \geq 10$ in the former, and $a \leq 0$ or $a \geq 4$ in the latter. 
Since we want 3 roots, this means one of the determinants has to be zero while the other is positive. Only $a=6$ satisfies this: for the first case, $x=1$ (only root: the determinant is zero). In the second case, $x=-2 \pm \sqrt 3$. You must also remember to check that the proposed solutions satisfy the domain of $x$ which you have fixed; indeed $1>0$ and  $-2 \pm \sqrt 3<0$.
So the answer necessitates $a=6$, from which it follows that $x=1$, $x=-2 \pm \sqrt 3$ are your three distinct solutions.
EDIT: Sorry, there is another solution in $a=4$, whereupon your roots are $x=2 \pm \sqrt 3$ and $x = -1$.
A: HINT...If you want to find solutions which comprise precisely three values of $x$, you will need to find the values of $a$ for which the parabola has either of the lines $y=\pm3x$ as tangents.
So, for example, if $y=-3x$ is tangent, then the equation $$x^2+(a-5)x+1=-3x$$ must have double roots, and this leads to the possible values $a=4, 0$
However, the $y$ value at the point of tangency must be non-negative, which means only $a=4$
then you can then write down the $x$ value at the tangent point, and for that chosen value of $a$ go ahead and find the other two values of $x$ by solving $$x^2+(a-5)x+1=+3x$$
