Mathematic struct for solving real quadratic equations
Mathematical motivation:
The equation is given by:
\( \alpha x^{2} + \beta x + \gamma = 0 \) and has therefore the analytical solution:
\( x_{1, 2} = - \frac{\beta \pm \sqrt{\beta^{2}-4\alpha\gamma}}{2\alpha}\)
- case \( \beta > 0 \):
\( x_{1} = - \frac{\beta + \sqrt{\beta^{2}-4\alpha\gamma}}{2\alpha} := \frac{q}{\alpha}\),
so that \( q= -\frac{1}{2}(\beta+sqrt{\beta^{2}-4\alpha\gamma})\). \( x_{2} \) can now be written as: \( x_{2} = \frac{\gamma}{q} = -\frac{2\gamma}{\beta+sqrt{\beta^{2}-4\alpha\gamma}}\), since:
\( -\frac{2\gamma}{\beta+sqrt{\beta^{2}-4\alpha\gamma}} = -\frac{2\gamma}{\beta}\frac{1}{1+\sqrt{1-4\alpha\gamma/\beta^{2}}}\), and
\( x_{2}\frac{1}{1-\sqrt{1-4\alpha\gamma/\beta^{2}}} = -\frac{2\gamma}{\beta}\frac{1}{1-1+4\alpha\gamma/\beta^{2}}=-\frac{\beta}{2\alpha}.\)
Hence, \( -\frac{\beta(1-\sqrt{1-4\alpha\gamma/\beta^{2}}}{2\alpha} = - \frac{\beta - \sqrt{\beta^{2}-4\alpha\gamma}}{2\alpha} \).
- case \( \beta > 0 \) is similar.
- Author
- Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch