Subject: Cubic and quartic polynomials
Date: 4 Mar 91 16:16:38 GMT
Organization: Digital Equipment Corporation
Lines: 102

Here are routines CUBIC and QUARTIC which solve cubic and quartic equations,
similar to the way that the QUAD function solves quadratic equations.  The
use for both is the same as QUAD:

	'symbolic1' 'global' -> 'symbolic2'

These routines are also similar to QUAD in that they compute a Taylor's series
of the appropriate degree (courtesy of PCOEF, previously posted by William
C. Wickes) and honor the principal values flag (-1).

The solutions are the exact algebraic solutions, so they will find complex
roots and duplicate roots.  The routines ABC and ABCD are for internal use but
might be usable anyway -- they take three or four coefficients, as in a, b, and
c of x^3+a*x^2+b*x+c or a, b, c, and d for the quartic, and return the solution
as an expression.  If you enter A B C D ABCD, you will get an algebraic that
represents the general solution for quartic equations.  It's 3,153 bytes and
takes thousands more to display.  (I only had 10Kb free; that wasn't enough to
hold the algebraic and display it.)

The programs N1 and S12 will take the general solution of a cubic or quartic,
respectively, and substitute the three or four combinations of values for the
n1 or s1 and s2 variables, returning the general solution and the three or
four specific solutions to the stack.


				-- edp (Eric Postpischil)
				"Always mount a scratch monkey."
