<s>[INST] Why does this alternative to the Quadratic Formula not always work? $x=\frac1a\left(-b+\sqrt{\frac12(b^2-2ac\pm b\sqrt{b^2-4ac})}\right)$ I was playing with quadratic formula a while ago and I was able to accidentally arrive at:
$$x=\frac{1}{a}\left(-b+\sqrt{\frac{(b^2-2ac)±b\sqrt{b^2-4ac}}{2}}\right) \tag{1}$$
However, I have not been able to solve it from scratch but I simplified it in some way to arrive back at the general quadratic equation. Here we go:
$$x=\frac{1}{a}\left(-b+\sqrt{\frac{(b^2-2ac)±b\sqrt{b^2-4ac}}{2}}\right)$$
$$2(ax+b)^2=b^2-2ac±b\sqrt{b^2-4ac}$$
$$2a^2x^2+4abx+b^2+2ac=±b\sqrt{b^2-4ac}$$
From the original quadratic formula, we know that
$$2ax+b=±\sqrt{b^2-4ac}$$
So
$$2a^2x^2+4abx+b^2+2ac=b(2ax+b)$$
$$2a^2x^2+2abx+2ac=0 \tag{2}$$
Dividing (2) by $a$ as $a≠0$, we have
$$ax^2+bx+c=0$$
Looks practically perfect, right?
I gave this to one of the maths experts in my environment for verification. Unfortunately, he was able to give a quadratic equation for which (1) could not solve and that is:
$$x^2-4x+4=0$$
After a thorough re-check through a series of examples, if we let $x_1$ and $x_2$ be the values of (1), i realized that the formula could find only one root if and only if
$$|x_1|=|x_2|$$

Question: what could be wrong with (1)? 
I am not claiming to have discovered a new quadratic formula, I am just curious about why (1) doesn't work generally.

 [/INST] Here is a better alternative for the quadratic formula:
Start with $ax^2+bx+c=0$.  We complete the square ... backwards, so to speak:
$(a-\frac{b^2}{4c})x^2+(\frac{b^2}{4c})(x+\frac{b}{2c})^2=0$
$(a-\frac{b^2}{4c})+(\frac{b^2}{4c})(1+\frac{b}{2cx})^2=0$
$(b+\frac{1}{2cx})^2=b^2-4ac$
$\color{blue}{x=\dfrac{2c}{-b\pm\sqrt{b^2-4ac}}}$
This formula finds use in computer programming, where it gives a better-conditioned result than the usual version of the quadratic formula when $|a|<|c|$. It also avoids division by zero if we are analyzing conditions where $c$ does not change sign but $a$ does so.
</s>