Solving a cubic equation using trigonometry, but with a2 term?



#2

Hi,



I read and entered this program here, after finding his Quadratic solver using ACOSH nice to use.



"Solving a cubic equation using trigonometry" by Thomas Klemm

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv020.cgi?read=180771



A general cubic equation can be transformed to the following form using a substitution;





 00 { 31-Byte Prgm }           00 { 34-Byte 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


However, it doesn't work if you have an a2 term, unless I've made a typo. Having to do substitution before using the program seems to defeat the purpose.



Daniel.

#3

Sure there is no a2 term: That's why it says "A general cubic equation can be transformed to the following form using a substitution". ;-) For more details see below.

There are well-known standard methods for solving cubic equations. Just take a look at de.wikipedia.org - as well as the last link ("Leitfaden") on that page for a step-by-step solution. The entry on
en.wikipedia.org is has some more details on the numerics.

Having read all this you may finally proceed to the actual algorithm. ;-) For instance by using Cardano's method as described on de.wikipedia.org. This is the method you will probably use.

Edit 1:
Oops, I was a bit too fast. ;-) I didn't notice you're not Thomas so you probably don't read German. However, the mentioned Cardano method first reduces the cubic equation to a simplified form without "a2 term" and then this reduced equation is solved. The latter part is already done by the program you got. So you just have to provide the initial reduction (or transformation, as Thomas said) the way it is described in the wikipedia articles. The rest is already there.

Edit 2:
All this has already been discussed in the thread you mentioned. Please read messages 3 - 5 there. ;-)

Dieter

Edited: 29 Sept 2011, 8:49 a.m.


Possibly Related Threads...
Thread Author Replies Views Last Post
  [HP Prime] Tips for Solving Differential Equations More Efficiently Chris Pem10 8 366 11-21-2013, 08:25 PM
Last Post: Chris Pem10
  Equation Library/App for the Prime Harold A Climer 3 220 10-30-2013, 10:14 AM
Last Post: CompSystems
  Equation Library on the PRIME Harold A Climer 0 125 10-26-2013, 10:01 AM
Last Post: Harold A Climer
  HP-PRIME CAS SOLVING fabrice48 8 391 10-19-2013, 01:21 PM
Last Post: Han
  Meltiple Equation Solver PRIME Vs. HP 50G Harold A Climer 5 279 10-07-2013, 05:11 PM
Last Post: CR Haeger
  HP Prime Solving Nonlinear System of Equations for Complex Results Helge Gabert 11 547 09-30-2013, 03:44 AM
Last Post: From Hong Kong
  EOT--TI N-Spire Equation Limit Matt Agajanian 2 183 09-22-2013, 12:37 PM
Last Post: Matt Agajanian
  Does Prime Have a Multiple Equation Solver? Norman Dziedzic 2 167 09-20-2013, 09:43 AM
Last Post: Norman Dziedzic
  Equation of the parabola given three points Gerson W. Barbosa 27 953 09-18-2013, 01:58 PM
Last Post: Gerson W. Barbosa
  Quadratic & Cubic Regression RPN progs Matt Agajanian 9 398 09-17-2013, 11:37 AM
Last Post: Jeff O.

Forum Jump: