]>
Book Contents Previous Section 1.12 Integration Next Section 1.14 Solution of Equations Book Index

## 1.13 Differential Equations

The general approach used in integration also carries over to the solution of linear differential equations.

Let's solve some differential equations. Let y be the unknown function in terms of x.

y := operator 'y

y

Type: BasicOperator

Here we solve a third order equation with polynomial coefficients.

deq := x**3 * D(y x, x, 3) + x**2 * D(y x, x, 2) - 2 * x * D(y x, x) + 2 * y x = 2 * x**4

x 3 y′′′(x)+x 2 y′′(x)-2 x y′(x)+2 y(x)=2 x 4

Type: Equation Expression Integer
solve(deq, y, x)

[particular=x 5-10 x 3+20 x 2+4 15 x,basis=[2 x 3-3 x 2+1 x,x 3-1 x,x 3-3 x 2-1 x]]

Type: Union(Record(particular: Expression Integer,basis: List Expression Integer),...)

Here we find all the algebraic function solutions of the equation.

deq := (x**2 + 1) * D(y x, x, 2) + 3 * x * D(y x, x) + y x = 0

(x 2+1)y′′(x)+3 x y′(x)+y(x)=0

Type: Equation Expression Integer
solve(deq, y, x)

[particular=0,basis=[1 x 2+1,log(x 2+1-x)x 2+1]]

Type: Union(Record(particular: Expression Integer,basis: List Expression Integer),...)

Coefficients of differential equations can come from arbitrary constant fields. For example, coefficients can contain algebraic numbers.

This example has solutions whose logarithmic derivative is an algebraic function of degree two.

eq := 2*x**3 * D(y x,x,2) + 3*x**2 * D(y x,x) - 2 * y x

2 x 3 y′′(x)+3 x 2 y′(x)-2 y(x)

Type: Expression Integer
solve(eq,y,x).basis

[e(-2 x),e 2 x]

Type: List Expression Integer

Here's another differential equation to solve.

deq := D(y x, x) = y(x) / (x + y(x) * log y x)

y′(x)=y(x)y(x)log(y(x))+x

Type: Equation Expression Integer
solve(deq, y, x)

y(x)log(y(x))2-2 x 2 y(x)

Type: Union(Expression Integer,...)

Rather than attempting to get a closed form solution of a differential equation, you instead might want to find an approximate solution in the form of a series.

Let's solve a system of nonlinear first order equations and get a solution in power series. Tell Axiom that x is also an operator.

x := operator 'x

x

Type: BasicOperator

Here are the two equations forming our system.

eq1 := D(x(t), t) = 1 + x(t)**2

x′(t)=x(t)2+1

Type: Equation Expression Integer
eq2 := D(y(t), t) = x(t) * y(t)

y′(t)=x(t)y(t)

Type: Equation Expression Integer

We can solve the system around t=0 with the initial conditions x(0)=0 and y(0)=1. Notice that since we give the unknowns in the order [x,y], the answer is a list of two series in the order [series for x(t),series for y(t)].

seriesSolve([eq2, eq1], [x, y], t = 0, [y(0) = 1, x(0) = 0])

[t+1 3 t 3+2 15 t 5+17 315 t 7+62 2835 t 9+O(t 11),1+1 2 t 2+5 24 t 4+61 720 t 6+277 8064 t 8+50521 3628800 t 10+O(t 11)]

Type: List UnivariateTaylorSeries(Expression Integer,t,0)
Book Contents Previous Section 1.12 Integration Next Section 1.14 Solution of Equations Book Index