Factoring a degree 4 polynomial without power of 2 term

106 Views Asked by At

For my hobby, I'm trying to solve $x$ for $ax^4 + bx^3 + dx + e = 0$. (note there's no $x^2$) I hope there is a simple solution.

I'm trying to write it as $(fx + g)(hx^3+i) = 0$

It follows that $fh=a; gh=b; if=d; gi=e$

At first sight it looks promising with 4 equations and 4 unknowns ($f,g,h,i$). Unfortunately when substituting them you'll find a dependency so that this only works when $db=ae$. Is there an easy solution for the more general case?

2

There are 2 best solutions below

1
On

I suppose that you are searching a decomposition of the given polynomial in factors with real coefficients.

First note that your condition $db=ae$ means $$ \frac{a}{d}=\frac{b}{e}=k $$ so the polynomial is obviously decomposable as: $$ kdx^4+kex^3+dx+e=kx^3(dx+e)+dx+e=(dx+e)(kx^3+1) $$

Also note that a degree $4$ polynmial without the $x^2$ term can be decomposable in other forms, as:

$$ 3x^4+5x^3+5x+3=(x^2+1)(3x^2+5x-3) $$

So, in general, also for a quartic equation of the given form, the solutions can be found only using the (not simple) general methods.

0
On

This is a bit offtopic, but I doubted wether I should open a new question for something similar. I managed to workaround in a way that I only needed to solve:

$x^4 + bx^3 + f = 0$

I put it in Wolfram: http://www.wolframalpha.com/input/?i=x%5E4%2Bb*x%5E3%2Bf+%3D+0

and my implementation in java works:

public class SolveQuad {

public final static double SQRT3 = Math.sqrt(3.0d);
public final static double CONST = Math.cbrt(2.0d) * Math.pow(3.0d, 2.0d/3.0d);


/*
 * Solves x for x^4 + b x^3 + f = 0;
 * http://math.stackexchange.com/a/1795504/220116
 * http://www.wolframalpha.com/input/?i=solve%20x%5E4%20%2B%20b%20x%5E3%20%2B%20f%20%3D%200%20for%20x
 */
public static double[] solveQuad(double b, double f) {
    double cbrt = Math.cbrt(SQRT3 * Math.sqrt(27.0d*b*b*b*b*f*f - 256.0d*f*f*f) + 9.0d*b*b*f);
    double cF = 4.0d * Math.cbrt(2.0d/3.0d) * f;
    double sqrtPlus = Math.sqrt(b*b/4.0d + cbrt/CONST + cF/cbrt); 
    double b3 = b*b*b / (4.0d * sqrtPlus);

    double sqrtMinus = Math.sqrt(b*b/2.0d - cbrt/CONST - cF/cbrt - b3);

    double x1 = 0.5d*sqrtPlus - 0.5d*sqrtMinus - b/4.0d;
    double x2 = 0.5d*sqrtPlus + 0.5d*sqrtMinus - b/4.0d;

    double sqrtMinusPlus = Math.sqrt(b*b/2.0d - cbrt/CONST - cF/cbrt + b3);

    double x3 = -0.5d*sqrtPlus - 0.5d*sqrtMinusPlus - b/4.0d;
    double x4 = -0.5d*sqrtPlus + 0.5d*sqrtMinusPlus - b/4.0d;

    return new double[] {x1, x2, x3, x4};
}
}