Solving a cubic equation using trigonometry Message #1 Posted by Thomas Klemm on 22 Mar 2011, 4:57 a.m.
A while ago I've posted a program that uses ACOSH to solve a quadratic equation:
Short Quadratic Solver (HP42S) Message #29
Recently I stumbled across a way to solve a cubic equation using trigonometry. Some of you might find that interesting as well.
Cheers
Thomas
Equations
A general cubic equation can be transformed to the following form using a substitution:
The trick is to use the following identity:
Here we set:
With the following substitution we can get a closedform solution:
A similar formula can be found using the following identity:
Programs
00 { 31Byte Prgm } 00 { 34Byte Prgm }
01>LBL "CuEq" 01>LBL "CuEqH"
02 2 02 2
03 / 03 /
04 X<>Y 04 X<>Y
05 3 05 3
06 / 06 /
07 / 07 /
08 LASTX 08 LASTX
09 SQRT 09 SQRT
10 / 10 /
11 LASTX 11 LASTX
12 X<>Y 12 X<>Y
13 ASIN 13 ASINH
14 3 14 3
15 / 15 /
16 SIN 16 SINH
17 * 17 *
18 2 18 2
19 * 19 *
20 END 20 END
Examples
x^{3} + 6x  2 = 0
CuEq: 3.27480002074E1 i0
CuEqH: 3.27480002074E1
x^{3} + 3x  4 = 0
CuEq: 1 i0
CuEqH: 1
References
Cubic Formula
Edited: 22 Mar 2011, 12:51 p.m. after one or more responses were posted
