edit, tldr: it seems like the question is interpreted as "for which combinations of a and f is there a solution to the expression"? I'm only interested in "for which combinations of a and f is the wolfram formula wrong". When the wolfram formula takes square roots of negative numbers or divides by zero, I consider it still correct if there was no solution anyway. But it has divisions by zero for b=0 and f=-1, while there should be solutions then. Does that also hold for some nonzero values of b?
For my hobby computer science project, I need to solve $x$ for $x^4+bx^3+f=0$. ($x, b, f\in \mathbb{R}$). I put the formula in wolfram alpha:
http://www.wolframalpha.com/input/?i=solve+x%5E4+%2B+b+x%5E3+%2B+f+%3D+0+for+x
and implemented the resulting four formula's from that page in Java. This works pretty well, for random values of $a$ and $f$ it always generates a good approximation of the solution set. However, for the "non-random" input {$b=0, f=-1$}, the wolfram formula (and hence my program) fail. It should have two solutions, $x=1$ and $x=-1$, but it gives none. I took a close look at the formula. Each of the four solutions has the same part $\frac{b^3}{\psi}$ (note the 3). When substituting $b=0$ and $f=-1$ into $\psi$, you'll get the formula here (removing the 4 and the square root):
Indeed, $\psi=0$ and $\frac{b^3}{\psi}$ is a division by zero.
- Is the solution given by wolfram wrong (1st link)?
- I can easily solve this in my program by checking if $b=0$. But is that enough or are there other combinations of $b$ and $f$ where this formula goes wrong?
The formulas given by Wolfram Alpha are not wrong, they're "generic". (Which is a very specific form of wrong which means "only wrong on a set so small that you shouldn't ever care if you're picking random numbers, but always contains the point your boss randomly asks about". Okay. Not really, but some days...)
The not generic versions can be generated via Mathematica's
Reduce[]function becauseReduce[], unlikeSolve[]andIntegrate[], does not give generic solutions.It turns out the behaviour you notice requires $f = 0$ and $b < 0$. You already have the
Root[]expressions for the other cases from Wolfram Alpha. The conditional ladder/tree shown above may not be optimal.