# How to solve for the roots of a 4th degree polynomial with complex coefficients?

Given the following equation

$c_4Z^4+c_3Z^3+c_2Z^2+(c_1+\frac{i}{\beta})Z^1-\frac{i}{\beta} =0$

where $Z$ lies in the complex domain. Each of the coefficients, $c_n$ for $n=1:4$, are real and can be either positive or negative. They are known, but left as variables here for the sake of generality. My objective is to determine expressions for each of the 4 roots and plot them versus $\beta$.

I have done this numerically using Matlab's roots function and got the correct results, but in order to plot each of the roots as a function of $\beta$ in a meaningful way, I have to sort them to appear as continuous curves or plot them as points in a scatter plot. Either way, it takes way too long to explore the full complex domain for $\beta$. This is a whole other issue, so don't lose focus here.

That being said, I'm wondering if I can solve for each of the roots in the form of an analytic expression as a function of $\beta$? If so, I could program each of the expressions as anonymous functions and save a bunch of time exploring the complex domain for $\beta$.

Unfortunately, my subpar math skills have left me scratching my head on how to proceed. I've looked at a bunch of different examples/tricks on determining the roots for 4th degree polynomials, but they all seem to apply to real polynomials with real coefficients. In the polynomial I've expressed above, $\beta$ can be complex. So again, my question is, can I solve for each of the roots in the form of an analytic expression as a function of $\beta$ and if so, how do I proceed given the complex nature of the polynomial?

• both α and β can be complex Where is $\alpha$? – dxiv Oct 13 '16 at 6:08
• You can, but it's going to be very, very messy and tedious. Ferrari's method for solving the general quartic applies with complex coefficients too. You might want to look into using a Computerised Algebra System, although I'm unsure if it can do this. – Deepak Oct 13 '16 at 6:10
• @Deepak Writing the roots as analytic expressions is not necessarily the same as solving by radicals. I imagine OP is looking for something along the lines of Puiseux series although I don't know enough about that to answer – user376902 Oct 13 '16 at 6:13
• @dxiv $Z=e^{i\alpha}$ – ThatsRightJack Oct 13 '16 at 6:18
• Ah, thanks, missed that somehow. Though I don't see how $Z=e^{i \alpha} \;\;|\;\; \alpha \in \mathbb{C}$ adds anything vs. simply $Z \in \mathbb{C}$ in the context of this quartic. – dxiv Oct 13 '16 at 6:22

## 2 Answers

Here is a solution to the general quartic compactified. Given,

$$Ax^4+Bx^3+Cx^2+Dx+E = 0$$

divide by $A$ to get the simpler,

$$x^4+ax^3+bx^2+cx+d=0$$

Then the four roots are,

$$x_{1,2} = -\frac{a}{4}+\frac{\color{red}\pm\sqrt{u}}{2}\color{blue}+\frac{1}{4}\sqrt{3a^2-8b-4u+\frac{-a^3+4ab-8c}{\color{red}\pm\sqrt{u}}}\tag1$$

$$x_{3,4} = -\frac{a}{4}+\frac{\color{red}\pm\sqrt{u}}{2}\color{blue}-\frac{1}{4}\sqrt{3a^2-8b-4u+\frac{-a^3+4ab-8c}{\color{red}\pm\sqrt{u}}}\tag2$$

where,

$$u = \frac{a^2}{4}-\frac{2b}{3} +\frac{1}{3}\left(v_1^{1/3}\zeta_3+\frac{b^2 - 3 a c + 12 d}{v_1^{1/3}\zeta_3}\right)$$

with $v_1$ any non-zero root of the quadratic,

$$v^2 + (-2 b^3 + 9 a b c - 27 c^2 - 27 a^2 d + 72 b d)v + (b^2 - 3 a c + 12 d)^3 = 0$$

and a chosen cube root of unity $\zeta_3^3 = 1$ such that $u$ is also non-zero. (Normally, just use $\zeta_3=1$, but not when $a^3-4ab+8c = 0$.)

P.S. This is essentially the method used by Mathematica, though much simplified for aesthetics.

• Do you already have this programmed and readily available in Mathematica? I tried to plot it in Matlab (using symbolic math) and did not receive the same solution as I did before using their internal "roots" function. One of us made an error copying and I just want to give a word of caution. – ThatsRightJack Oct 17 '16 at 23:58
• @ThatsRightJack: I re-implemented it by copying from scratch the solution above and got a correct result. What's the $a,b,c,d$ of the test quartic you used and what did you get for $u,v,x$? – Tito Piezas III Oct 18 '16 at 2:16
• @ThatsRightJack: For example, using $x^4 - 2 x^3 + 5x^2 - 11x + 19=0$, I got $u\approx4.7769,\;v\approx-1130.5-2293.7246i,\,x_1\approx1.5928+1.1588i$. What values do you get? – Tito Piezas III Oct 18 '16 at 2:22
• Hmmm....now I'm really scratching my head. I got the same answer you did for your test case. Let me take a closer look at it again tomorrow and follow up with more details regarding the known coeffs and solution for comparison purposes. – ThatsRightJack Oct 18 '16 at 3:55
• Just to be clear, this general solution does hold for complex coeffs? If you notice in my question, D and E (or after dividing through by A, c and d) are complex. Just wanted to be sure....again, I'll look closer tomorrow and get back to you. – ThatsRightJack Oct 18 '16 at 4:13

First depress the equation by translating the variable $$x\to x-\dfrac a4$$, giving

$$x^4+px^2+qx+r=0.$$

Now factor this in two quadratic polynomials in such a way that the cubic term is missing (mind the reuse of the coefficient names)

$$(x^2+ax+b)(x^2-ax+c)=x^4+(-a^2+b+c)x^2+a(c-b)x+bc.$$

By identification,

$$\begin{cases}-a^2+b+c=p\implies ab+ac=a^3+pa,\\ac-ab=q,\\bc=r\end{cases}.$$

From the first two equations, you draw $$ab,ac$$ in terms of $$a$$ and plug in the third.

$$\left(a^3+pa-q\right)\left(a^3+pa+q\right)=4ra^2,$$

giving by magic a cubic equation in $$a^2$$,

$$(a^2)^3+2p(a^2)^2+(p^2-4r)a^2-q^2=0.$$

Once solved for $$a$$, you get $$b,c$$ and solve the two quadrics.

For the cubic $$x^3+ax^2+bx+c$$, first depress by the change $$x\to x-\dfrac a3$$ to the form

$$x^3+px+q=0.$$

Then set

$$x=u-\frac{p}{3u}$$ so that by substitution

$$u^3+q-\frac{p^3}{27u^3}=0$$ or

$$(u^3)^2+qu^3-\frac{p^3}{27}=0.$$

Solve the quadratic for $$u^3$$ and you are... done.