<s>[INST] Express the value of $s\left(m\right)=\frac{1}{a^2}+\frac{1}{b^2}+\frac{1}{c^2}+\frac{1}{d^2}$ in terms of $m$. The previous question was: Find the range such that the equation $|x^2 -3x +2|=mx $ has 4 distinct real solutions: $a,b,c,d$, and that turned out to be $0<m<3-2\sqrt{2}$. The book says that the solution is $\frac{m^2+5}{2}$. I have been trying to express $a$ and $b$ as the two possible results from the quadratic equation resulting from $x^2−3x+2=mx$, and $c$ and $d$ as the ones from the equation $x^2−3x+2=-mx$, and plugging that into $\frac{1}{a^2}+\frac{1}{b^2}+\frac{1}{c^2}+\frac{1}{d^2}$, yet I do not see how a complicated expression can end up being the answer given by the book. Therefore I am sure I must be doing something wrong. 
 [/INST] The quadratic equation $x^2+px+q=0$ has two distinct roots, namely $$r_1=\frac{-p+\sqrt{p^2-4q}}{2}\qquad\text{and}\qquad r_2=\frac{-p-\sqrt{p^2-4q}}{2}\qquad\text{whenever }\,p^2-4q>0$$
Then $$r_1r_2=q\qquad\text{and}\qquad r_1^2+r_2^2=p^2-2q$$
It follows that $$\frac1{r_1^2}+\frac1{r_2^2}=\frac{r_1^2+r_2^2}{(r_1r_2)^2}=\frac{p^2-2q}{q^2}$$
So, regarding that the two solutions of the given equation are also solutions of $x^2-(m+3)x+2=0$ and the other two are solutions of $x^2+(m-3)x+2=0$, we get
$$s(m)=\frac{(-m-3)^2-2(2)}{2^2}+\frac{(m-3)^2-2(2)}{2^2}=\frac{m^2+5}{2}$$
</s>