The Student Room Group

Cubic formula

I was wondering if anyone could help me with this,

I've been trying to find a formula that outputs the three solutions to the general cubic equation ax³ + bx² + cx + d = 0, similar to the quadratic formula [-b ± √(b² - 4ac)]/2a.

I've found pages similar to this one before, but after following the steps they suggest, I always seem to end up with square roots of negative numbers, when I don't think I'm supposed to.

For example, the simple cubic - 2x² - 13x - 10 = 0 has roots -2, -1 and 5, but when I use the formula suggested, I get A = -43/9, B = 248/27, and + = -6001/243, which I'm then supposed to square root. It doesn't make any sense to me...I must be missing something obvious, but any help would be greatly appreciated. :smile:
Reply 1
This is very hard for A-level.

Basically, simplify it to a cubic of the form x^3 + ax^2 + bx + c = 0 by dividing through.

Now let y = x+(a/3). It follows x = y-(a/3). and you get

(y-a/3)^3 + a(y-a/3)^2 + b(y-a/3) + c = 0.

This gives y^3 - ay^2 + a^2y/3 - a^3/27 + ay^2 - 2a^2y/3 +a^3/9 + by - ab/3 + c = 0.

This simplifies to:

y^3 + (b-a^2/3)y + (2a^3/27-ab/3+c) = 0.

Now you have an equation of the form x^3 + px = q.

These can be solved using vieta's substitution, see here: http://icl.pku.edu.cn/yujs/MathWorld/math/v/v082.htm
Reply 2
beauford
This is very hard for A-level.


At A-level, they would've expected us to iterate to the answer, or they'd give us a factor and we could divide the cubic by it to obtain a quadratic we could factorise.

I've studied some of the other methods of solving cubics, but I really wanted something where I just plug in the coefficients a, b, c and d and get my answers. Thanks for your post though. :smile:
Reply 3
Squishy
At A-level, they would've expected us to iterate to the answer, or they'd give us a factor and we could divide the cubic by it to obtain a quadratic we could factorise.

I've studied some of the other methods of solving cubics, but I really wanted something where I just plug in the coefficients a, b, c and d and get my answers. Thanks for your post though. :smile:


Exactly, at a-level they keep it simple, giving you cubics you can factorise easily.

There is a formula, which is here http://mathworld.wolfram.com/CubicEquation.html (19-21).

Basically, i've tried to show you the method of getting the formula, instead of presenting you with a horribly complex thing that looks stupid, i hope you can see how they get the formula, it's definitely not nice :smile:
Reply 4
Heh, Wolfram was the first place I checked, but their formula doesn't work (see my post above). Either that, or I'm not understanding it properly. *sigh* I need a break from maths. I've been doing it for far too long today. Nite. :smile:
Reply 5
Squishy
Heh, Wolfram was the first place I checked, but their formula doesn't work (see my post above). Either that, or I'm not understanding it properly. *sigh* I need a break from maths. I've been doing it for far too long today. Nite. :smile:


No offence, you're probably just plugging in the numbers wrong :smile: maybe a good idea to take a break, it's a tad late.
Reply 6
Simple AS method of solving cubics, well, the one you are meant to use anyway...

- 2x² - 13x - 10 = 0

Use Trial and Error to find one root, normally between +/-3

try x=0, 0-0-0-10 = -10
x=-1, -1-2+13-10 = 0

so one root is shown to be x=-1, so x+1 is a factor...

factorise using this factor which you ahve now found..

(x+1)(x²+bx-10)

write the original and above equal to each other...

x³-2x²-13x-10=(x+1)(x²+bx-10)

collect the terms from both sides...

-2x²=x²+bx² (x*bx = bx², x²*1 = x²)

divide through by

-2=1+b

rearrange to find b

b = -2-1
b=-3

put b=-3 back into the partially-factorised cubic, (x+1)(x²+bx-10)

(x+1)(x²+bx-10) => (x+1)(x²-3x-10)

solve the quadratic, ie, (x²-3x-10) either by using the quadratic equation, completing the square or factorising. as you can see, this factorises really easily...

(x²-3x-10) = (x-5)(x+2)

from this we can see, x=5, or x=-2. from before we showed that x=-1

so x=-2, x=-1, x=5

they always say express the cubic it as the product of its factors

so

- 2x² - 13x - 10 = (x+2)(x+1)(x-5)

done, easy as Pi... this may seem long and tedious, but once you know the method the answer pops out like a dream after a couple of minutes calculating...

just wait till p4, when you do this exact same method for complex cubics, ie using imaginary factors

El Stevo
Reply 7
Squishy
I was wondering if anyone could help me with this,

I've been trying to find a formula that outputs the three solutions to the general cubic equation ax³ + bx² + cx + d = 0, similar to the quadratic formula [-b ± √(b² - 4ac)]/2a.

I've found pages similar to this one before, but after following the steps they suggest, I always seem to end up with square roots of negative numbers, when I don't think I'm supposed to.

For example, the simple cubic - 2x² - 13x - 10 = 0 has roots -2, -1 and 5, but when I use the formula suggested, I get A = -43/9, B = 248/27, and + = -6001/243, which I'm then supposed to square root. It doesn't make any sense to me...I must be missing something obvious, but any help would be greatly appreciated. :smile:


You proabably entered the numbers right (if you're sure) but don't forget that the square roots of negative numbers can be in the solution. You may need to teach yourself about imaginary/complex numbers including the square root of -1.
Reply 8
Gaz031
You proabably entered the numbers right (if you're sure) but don't forget that the square roots of negative numbers can be in the solution. You may need to teach yourself about imaginary/complex numbers including the square root of -1.

I'm sure that his new teachers would help him out a fair bit:wink:.