Cubic Formula

Routine Summary

Solves for the complex roots of a cubic equation.

Inputs

A, B, C, D - the constants in Ax3+Bx2+Cx+D=0

Outputs

The three roots (or repeated roots)

Variables Used

A, B, C, D, M, N, O, P, Q, R, U, V, W

Calculator Compatibility

TI-83/84/+/SE

Author

theFlyingDutchman

URL: United TI

Download

cubicformula.zip

ClrHome
Disp "AX³+BX²+CX+D=0
Prompt A,B,C,D
2B³-9ABC+27A²D→R
√(Ans²-4(B²-AC)³→M
³√(0.5(R+Ans→N
³√(0.5(R-M→O
(1+i√(3))/6A→P
(1-i√(3))/6A→Q
3A→E
-B/Ans→F
Ans+(-N-O)/E→U
F+PN+QO→V
F+QN+PO→W
Disp "X1=",U
Disp "X2=",V
Disp "X3=",W

This is the complete program used to give the three roots that solve the cubic equation. If there are less than 3 roots, it will still give three answers. Because the formula used to solve cubic equations is quite big, several repeated parts are turned into variables.

.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.