Section1.14

]>
Book Contents Previous Section 1.13 Differential Equations Next Section 1.15 System Commands Book Index

## 1.14 Solution of Equations

Axiom also has state-of-the-art algorithms for the solution of systems of polynomial equations. When the number of equations and unknowns is the same, and you have no symbolic coefficients, you can use solve for real roots and complexSolve for complex roots. In each case, you tell Axiom how accurate you want your result to be. All operations in the solve family return answers in the form of a list of solution sets, where each solution set is a list of equations.

A system of two equations involving a symbolic parameter t.

S(t) == [x**2-2*y**2 - t,x*y-y-5*x + 5]
Type: Void

Find the real roots of S(19) with rational arithmetic, correct to within 1/10 20.

solve(S(19),1/10**20)

[[y=5, x=-2451682632253093442511 295147905179352825856],[y=5, x=2451682632253093442511 295147905179352825856]]

Type: List List Equation Polynomial Fraction Integer

Find the complex roots of S(19) with floating point coefficients to 20 digits accuracy in the mantissa.

complexSolve(S(19),10.e-20)

[[y=5. 0, x=8. 3066238629 180748526],[y=5. 0, x=-8. 3066238629 180748526],[y=-3. 0 i, x=1. 0],[y=3. 0 i, x=1. 0]]

Type: List List Equation Polynomial Complex Float

If a system of equations has symbolic coefficients and you want a solution in radicals, try radicalSolve.

radicalSolve(S(a),[x,y])

[[x=-a+50, y=5],[x=a+50, y=5],[x=1, y=-a+1 2],[x=1, y=--a+1 2]]

Type: List List Equation Expression Integer

For systems of equations with symbolic coefficients, you can apply solve, listing the variables that you want Axiom to solve for. For polynomial equations, a solution cannot usually be expressed solely in terms of the other variables. Instead, the solution is presented as a ``triangular'' system of equations, where each polynomial has coefficients involving only the succeeding variables. This is analogous to converting a linear system of equations to ``triangular form''.

A system of three equations in five variables.

eqns := [x**2 - y + z,x**2*z + x**4 - b*y, y**2 *z - a - b*x]

[z-y+x 2, x 2 z-b y+x 4, y 2 z-b x-a]

Type: List Polynomial Integer

Solve the system for unknowns [x, y, z], reducing the solution to triangular form.

solve(eqns,[x,y,z])

[[x=-a b, y=0, z=-a 2 b 2],[x=z 3+2 b z 2+b 2 z-a b, y=z+b, z 6+4 b z 5+6 b 2 z 4+(4 b 3-2 a)z 3+(b 4-4 a b)z 2-.2 a b 2 z-b 3+a 2=0]]

Type: List List Equation Fraction Polynomial Integer
Book Contents Previous Section 1.13 Differential Equations Next Section 1.15 System Commands Book Index