Given equation: $$2x^2 - (a+1)x + (a-1)=0$$ I have to find when the difference of two roots is equal to its product, i.e.: $$x_1x_2 = x_1 - x_2.$$
From Vieta's formulas we know that: $$x_1 + x_2 = \frac{a + 1}{2},$$ $$x_1x_2 = \frac{a-1}{2} = x_1 - x_2.$$
Then, solving system of equations: $$x_1 + x_2 = \frac{a + 1}{2}$$ $$x_1 - x_2 = \frac{a-1}{2}$$ we get that $x_1 = \frac{a}{2}$ and $x_2 = \frac{1}{2}$. Then, plugging it into equation $x_1x_2 = x_1 - x_2$ we get: $$\frac{a}{4} = \frac{a - 1}{2}$$ $$4a - 4 = 2a$$ $$2a = 4$$ $$a = 2.$$ Plugging $2$ into previous equation we get that $\frac{1}{2} = \frac{1}{2}$, so solution have to be true.
Is my approach correct? If so, are there another ways to solve those kind of problems?
Using by the formula $${ \left( { x }_{ 1 }-{ x }_{ 2 } \right) }^{ 2 }+4{ x }_{ 1 }{ x }_{ 2 }={ \left( { x }_{ 1 }+{ x }_{ 2 } \right) }^{ 2 }$$ make be easy