Third-Degree Equation Solver

\(\small{a*x^3+b*x^2+c*x+d=0}\) type cubic equations with real or complex coefficients. The tool returns all roots of the equation as real or complex numbers.
Note 1: \(a \ne 0\) must hold.
Note 2: If a coefficient is a real number, write the real part in the first box and set the second box to zero. If a coefficient is a complex number, write the real part in the first box and the imaginary part in the second box.
Coefficients
\(a=\) + \(i\)
\(b=\) + \(i\)
\(c=\) + \(i\)
\(d=\) + \(i\)
From formulas (1) and (2), the values of \(\alpha\) and \(\beta\) are obtained. Using these values, the value of \(\Delta\) is calculated. From \(\alpha\), \(\beta\), and \(\Delta\), the roots \(x_1\), \(x_2\), and \(x_3\) are determined. The symbol \(i\) in the formulas represents the imaginary unit and is equal to \(i=\sqrt{-1}\). \begin{equation} \alpha=\frac{d}{2a} + \frac{b^3}{27a^3} - \frac{bc}{6a^2} \end{equation} \begin{equation} \beta=\frac{c}{3a} -\frac{b^2}{9a^2} \end{equation} \begin{equation} \Delta= \sqrt{\alpha^2 + \beta^3}-\alpha \end{equation} \begin{equation} x_1=\sqrt[3]{\Delta} -\frac{b}{3a} - \frac{\beta}{\sqrt[3]{\Delta}} \end{equation} \begin{equation} \begin{array}{ll} x_2 &=\displaystyle \frac{\beta}{2 \sqrt[3]{\Delta }} -\frac{b}{3a}-\frac{1}{2}\sqrt[3]{\Delta} \\ &-\displaystyle \frac{\sqrt{3}}{2}\left\{\displaystyle \frac{\beta}{\sqrt[3]{\Delta }} + \sqrt[3]{\Delta }\right\} i \end{array} \end{equation} \begin{equation} \begin{array}{ll} x_3 &=\displaystyle \frac{\beta}{2 \sqrt[3]{\Delta}} -\frac{b}{3a}-\frac{1}{2}\sqrt[3]{\Delta } \\ &+\displaystyle \frac{\sqrt{3}}{2}\left\{\displaystyle \frac{\beta}{\sqrt[3]{\Delta}} + \sqrt[3]{\Delta }\right\} i \end{array} \end{equation}