Higher Order Differential Equations. The Laplace Transform and Special Types of Equations
Ordinary High-Order Equations
An ordinary linear differential equation of order n has the following general form:
If the function f (x) is identically zero, the equation is called homogeneous. Otherwise, the equation is called non-homogeneous. If the functions ai(x) (i = 1, …, n) are constant, the equation is said to have constant coefficients.
A concept of great importance in this context is that of a set of linearly independent functions. A set of functions { f1(x), f2(x), …, fn(x)} is linearly independent if, for any x in their common domain of definition, the Wronskian determinant of the functions is non-zero. The Wronskian determinant of the given set of functions, at a point x of their common domain of definition, is defined as follows:
The MATLAB command maple(‘Wronskian’) allows you to calculate the Wronskian matrix of a set of functions. Its syntax is:
A set S = { f1(x), …, fn(x)} of linearly independent non-trivial solutions of a homogeneous linear equation of order n
is called a set of fundamental solutions of the equation.
If the functions ai(x) (i = 1, …, n) are continuous in an open interval I, then the homogeneous equation has a set of fundamental solutions S = {fi(x)} in I.
In addition, the general solution of the homogeneous equation will then be given by the function:
where {ci} is a set of arbitrary constants.
The equation:
is called the characteristic equation of the homogeneous differential equation with constant coefficients. The solutions of this characteristic equation determine the general solutions of the corresponding differential equation.
EXERCISE 3-1
Show that the set of functions
is linearly independent.
» indfunctions = maple('vector([exp(x), x * exp(x), x ^ 2 * exp(x)])')
indfunctions =
[exp(x), x * exp(x), x ^ 2 * exp(x)]
» W=maple('Wronskian(indfunctions,x)')
W =
[exp(x), x*exp(x), x^2*exp(x)]
[exp(x), exp(x)+x*exp(x), 2*x*exp(x)+x^2*exp(x)]
[exp(x), 2*exp(x)+x*exp(x), 2*exp(x)+4*x*exp(x)+x^2*exp(x)]
» pretty(determ(W))
3
2 exp(x)
This gives us the value of the Wronskian, which is obviously always non-zero. Therefore the set of functions is linearly independent.
Linear Higher-Order Equations. Homogeneous Equations with Constant Coefficients
The homogeneous linear differential equation of order n
is said to have constant coefficients if the functions ai(x) (i = 1, …, n) are all constant (i.e. they do not depend on the variable x).
The equation:
is called the characteristic equation of the above differential equation. The solutions (m1, m2, …, mn) of this characteristic equation determine the general solution of the associated differential equation.
If the mi (i = 1, …, n) are all different, the general solution of the homogeneous equation with constant coefficients is:
where c1, c2, …, cn are arbitrary constants.
If some mi is a root of multiplicity k of the characteristic equation, then it determines the following k terms of the solution:
If the characteristic equation has a complex root mj = a+bi , then its complex conjugate mj+1 = a-bi is also a root. These two roots determine a pair of terms in the general solution of the homogeneous equation:
MATLAB directly applies this method to obtain the solutions of homogeneous linear equations with constant coefficients, using the command dsolve or maple(‘dsolve’).
EXERCISE 3-2
Solve the following equations:
» pretty(dsolve('3*D2y+2*Dy-5*y=0'))
/ 5 t
C38 exp(t) + C39 exp| - --- |
3 /
» pretty(dsolve('2 * D2y + 5 * Dy + 5 * y = 0', ' y(0) = 0 Dy(0) = 1/2 '))
/ 1/2
1/2 / 5 t | 15 t |
2 15 exp| - --- | sin| ------- |
4 / 4 /
-----------------------------------
15
EXERCISE 3-3
Solve the differential equation
» pretty(simple(dsolve('9*D4y-6*D3y+46*D2y-6*Dy+37*y=0')))
/ t / t
C46 cos(t) + C47 sin(t) + C44 cos(2 t) exp| - | + C45 sin(2 t) exp| - |
3 / 3 /
Looking at the solution, it is evident that the characteristic equation has two pairs of complex conjugate solutions.
» solve('9*x^4-6*x^3+46*x^2-6*x+37=0')
ans =
i
-i
1/3 + 2*i
1/3 - 2*i
Non-Homogeneous Equations with Constant Coefficients. Variation of Parameters
Consider the non-homogeneous linear equation with constant coefficients:
Suppose { y1(x), y2(x),....., yn(x)} is a linearly independent set of solutions of the corresponding homogeneous equation:
A particular solution of the non-homogeneous equation is given by:
where the functions ui(x) are obtained as follows:
Here Wi[ y1(x), y2(x), …, yn(x)] is the determinant of the matrix obtained by replacing the i-th column of the Wronskian matrix W[ y1(x), y2(x), …, yn(x)] by the transpose of the vector (0, 0,…, 0, 1).
The solution of the non-homogeneous equation is then given by combining the general solution of the homogeneous equation with the particular solution of the non-homogeneous equation. If the roots mi of the characteristic equation of the homogeneous equation are all different, the general solution of the non-homogeneous equation is:
If some of the roots are repeated, we refer to the general form of the solution of a homogeneous equation discussed earlier.
EXERCISE 3-4
Solve the following differential equations:
We will follow the algebraic method of variation of parameters to solve the first equation. We first consider the characteristic equation of the homogeneous equation to obtain a set of linearly independent solutions.
» solve('m^2+4*m+13=0')
ans =
[- 2 + 3 * i]
[- 2 - 3 * i]
» maple('f: = x - > x * cos(3*x) ^ 2');
» maple('y1: = x - > exp(-2*x) * cos(3*x)');
» maple('y2: = x - > exp(-2*x) * sin(3*x)');
» maple('W: = x - > Wronskian([y1(x), y2(x)], x)');
» pretty(simplify(maple('det(W(x))')))
3 exp(-4 x)
We see that the Wronskian is non-zero, indicating that the functions are linearly independent. Now we calculate the functions Wi (x), i = 1, 2.
» maple('W1: x-= > array([[0, y2(x)], [1, diff((y2)(x), x)]])');
» pretty(simplify(maple('det(W1(x))')))
-exp(-2 x) sin(3 x)
» maple('W2: x-= > array([[y1(x), 0], [diff((y1)(x), x), 1]])');
» pretty(simplify(maple('det(W2(x))')))
exp(-2 x) cos(3 x)
Now we calculate the particular solution of the non-homogeneous equation.
» maple('u1:=x->factor(simplify(int(f(x)*det(W1(x))/det(W(x)),x)))');
» maple('u1(x)')
ans =
1/14652300*exp(2*x)*(129285*cos(9*x)*x-6084*cos(9*x)-28730*sin(9*x)*x-13013*sin(9*x)+281775*cos(3*x)*x-86700*cos(3*x)-187850*sin(3*x)*x-36125*sin(3*x))
» maple('u2:=x->factor(simplify(int(f(x)*det(W2(x))/det(W(x)),x)))');
» maple('u2(x)')
ans =
1/14652300 * exp(2*x) *(563550 * cos(3*x) * x+108375 * cos(3*x) + 845325 * sin(3*x) * x-260100 * sin(3*x) + 28730 * cos(9*x) * x+13013 * cos(9*x) + 129285 * sin(9*x) * x-6084 * sin(9*x))
» maple('yp: = x - > factor(simplify(y1(x) *(x) u1 + y2(x) * u2(x)))');
» maple('yp(x)')
ans =
-23/1105 * x * cos(3*x) ^ 2 + 13436/1221025 * cos(3*x) ^ 2 + 24/1105 * cos(3*x) * sin(3*x) * x + 3852/1221025 * cos(3*x) * sin(3*x) + 54/1105 * x-21168/1221025
Then we can write the general solution of the non-homogeneous equation:
» maple(' y: = x - > simplify(c1 * y1(x) + c2 * y2(x) + yp(x))');
» maple('combine(and(x), trig)')
ans =
C1 * exp(-2*x) * cos(3*x) + c2 * exp(-2*x) * sin(3*x)-23/2210 * x * cos(6*x) + 1/26 * x + 6718/1221025 * cos(6*x)-2/169 + 12/1105 * x * sin(6*x) + 1926/1221025 * sin(6*x)
Now we graphically represent a set of solutions, for certain values of c1 and c2 (see Figure 3-1)
» fplot(simplify('subs(c1=-5,c2=-4,y(x))'),[-1,1])
» hold on
» fplot(simplify('subs(c1=-5,c2=4,y(x))'),[-1,1])
» fplot(simplify('subs(c1=-5,c2=2,y(x))'),[-1,1])
» fplot(simplify('subs(c1=-5,c2=-2,y(x))'),[-1,1])
» fplot(simplify('subs(c1=-5,c2=-1,y(x))'),[-1,1])
» fplot(simplify('subs(c1=-5,c2=1,y(x))'),[-1,1])
» fplot(simplify('subs(c1=5,c2=1,y(x))'),[-1,1])
» fplot(simplify('subs(c1=5,c2=-1,y(x))'),[-1,1])
» fplot(simplify('subs(c1=5,c2=-2,y(x))'),[-1,1])
» fplot(simplify('subs(c1=5,c2=2,y(x))'),[-1,1])
» fplot(simplify('subs(c1=5,c2=4,y(x))'),[-1,1])
» fplot(simplify('subs(c1=5,c2=-4,y(x))'),[-1,1])
» fplot(simplify('subs(c1=0,c2=-4,y(x))'),[-1,1])
» fplot(simplify('subs(c1=0,c2=4,y(x))'),[-1,1])
» fplot(simplify('subs(c1=0,c2=2,y(x))'),[-1,1])
» fplot(simplify('subs(c1=0,c2=-2,y(x))'),[-1,1])
» fplot(simplify('subs(c1=0,c2=-1,y(x))'),[-1,1])
» fplot(simplify('subs(c1=0,c2=1,y(x))'),[-1,1])
For the second differential equation we directly apply dsolve, obtaining the solution:
» pretty(simple(dsolve('D2y-2 * Dy + y = exp(x) * log(x)')))
exp(x) log(x) + C49 exp(t) + C50 t exp(t)
Non-Homogeneous Equations with Variable Coefficients. Cauchy–Euler Equations
A non-homogeneous linear equation with variable coefficients of the form
is called a Cauchy–Euler equation.
MATLAB can solve this type of equation directly with the command dsolve or maple(‘dsolve’).
EXERCISE 3-5
Solve the following differential equation:
» pretty(simple(dsolve('x^3*D3y+16*x^2*D2y+79*x*Dy+125*y=0')))
C1 + C2 sin(3 log(x)) x + C3 cos(3 log(x)) x
--------------------------------------------
5
x
The Laplace Transform
Suppose f (t) is a function defined in the interval (0, ∞). The Laplace transform of f(t) is the function F(s) defined by:
We say that f (t) is the inverse Laplace transform of F(s), so that
MATLAB provides the commands maple(‘laplace’) and maple(‘invlaplace’) to calculate the Laplace transform and inverse Laplace transform of an expression with respect to a variable. Its syntax is as follows:
Here are some examples.
» pretty(maple('laplace(t^(3/2)-exp(t)+sinh(a*t), t, s)'));
1/2
pi 1 a
3/4 ----- - ----- + -------
5/2 s - 1 2 2
s s - a
» pretty(maple('invlaplace(s^2/(s^2+a^2)^(3/2), s, t)'))
- t BesselJ(1, a t) a + BesselJ(0, a t)
The Laplace transform and its inverse are used to solve certain differential equations. The method is to calculate the Laplace transform of each term of the equation to obtain a new differential equation, which we then solve. Finally, we find the solution of the original equation by applying the inverse Laplace transform to the solution just found.
MATLAB provides the ‘laplace’ option in the maple(‘dsolve’) command, which forces the program to solve the differential equation using the Laplace transform method. The syntax is as follows:
maple('dsolve(equation, func(var), 'laplace')')
EXERCISE 3-6
Solve the differential equation
using the Laplace transform method.
First, we calculate the Laplace transform of each side of the differential equation, and we apply the initial conditions.
» maple('L:=s->laplace(diff(y(x),x$2)+2*diff(y(x),x)+4*y(x),x,s)');
» pretty(simplify('subs(y(0)=1,(D(y))(0)=1,L(s))'))
laplace(y(x), x, s) s - s - 3 + 2 laplace(y(x), x, s) s
+ 4 laplace(y(x), x, s)
» maple('L1:=s->laplace(x-exp(-x),x,s)');
» pretty(simplify('L1(s)'))
1 1
---- - -----
2 s + 1
s
We then solve the Laplace transformed differential equation:
» pretty(simplify(maple('solve(L(s)=L1(s),laplace(y(x),x,s))')))
4 3 2
s y(0) + (3 y(0) + D(y)(0)) s + (2 y(0) + D(y)(0) - 1) s + s + 1
-------------------------------------------------------------------
2 3 2
s (s + 3 s + 6 s + 4)
Now we substitute the given initial conditions into the solution.
» maple('TL:=s->solve(L(s)=L1(s),laplace(y(x),x,s))');
» pretty(simplify('subs(y(0)=1,(D(y))(0)=1,TL(s))'))
4 3 2
s + 4 s + 2 s + s + 1
--------------------------
2 2
s (s + 1) (s + 2 s + 4)
This gives the solution of the Laplace transformed equation. To calculate the solution of the original equation we calculate the inverse Laplace transform of the solution obtained in the previous step.
» maple('TL0:=s->simplify('subs(y(0)=1,(D(y))(0)=1,TL(s))')');
» solucion=simple(maple('invlaplace(TL0(s),s,x)'));
» pretty(solution)
1/2 1/2 1/2
1 sin(3 x) 3 35 cos(3 x)
1/4 x - 1/8 - -------- + 5/8 ---------------- + ---- -----------
3 exp(x) exp(x) 24 exp(x)
This gives the solution of the original differential equation.
We could also have solved it directly via:
» pretty(simple(sym(maple('dsolve({diff(y(x),x$2)+2*diff(y(x),x)+4*y(x) = x-exp(-x), y(0)=1,D(y)(0)=1},y(x),laplace)'))))
1/2 1/2 1/2
1 sin(3 x) 3 35 cos(3 x)
y(x) = 1/4 x - 1/8 - -------- + 5/8 ---------------- + ---- -----------
3 exp(x) exp(x) 24 exp(x)
Orthogonal Polynomials
Two functions f (x) and g(x) are said to be orthogonal on an interval [a, b] if their inner product is 0, i.e. if
An example of an orthogonal family of functions (i.e. such that any two distinct functions in the family are orthogonal) is given by:
fn(x) = sin(nx) and gn(x) = cos(nx), n = 1, 2, 3, …, in the interval [−π, π].
MATLAB provides a broad list of orthogonal polynomials, which are very useful in solving certain non-linear differential equations of higher order. The functions that allow us to work with these polynomials are the following:
Now let us look at their relationship to differential equations. It is precisely this relationship which allows us to find solutions of some non-linear equations of higher order. To use these functions we first need to run maple(‘with orthopoly’).
Chebychev Polynomials of the First and Second Kind
The Chebychev polynomials of the first kind are defined as the solutions Tn(x) of the differential equation:
Their orthogonality is given by the weighted inner product:
The Chebychev polynomials of the second kind Un(x) are special cases of the Jacobi polynomials (see below) with a = b = 1/2. They satisfy the orthogonality relationship:
Legendre Polynomials
The Legendre polynomials Pn(x) are solutions of the Legendre differential equation:
Their orthogonality is given by the relation
Associated Legendre Polynomials
The solutions of the differential equation
are called associated Legendre polynomials.
Their orthogonality is given by the relation
where dk. l is the Kronecker delta.
Hermite Polynomials
The solutions Hn(x) of the Hermite differential equation
are known as Hermite polynomials.
Their orthogonality is given by the weighted inner product:
Generalized Laguerre Polynomials
The solutions Ln(x) of the general Laguerre differential equation
are known as generalized Laguerre polynomials.
Their orthogonality is given by the weighted inner product:
Laguerre Polynomials
The solutions of the Laguerre differential equation
are known as Laguerre polynomials. This is the particular case a = 0 of the generalized Laguerre polynomials.
Jacobi Polynomials
The solutions of the Jacobi differential equation
are known as Jacobi polynomials.
Their orthogonality is given by the weighted inner product:
Gegenbauer Polynomials
The Gegenbauer polynomial G(n, a, x) is defined as follows:
The solutions of the Gegenbauer differential equation
are known as Gegenbauer polynomials.
Their orthogonality is given by the weighted inner product:
EXERCISE 3-7
Find the solutions to the following differential equations:
» pretty(simple(maple('T(7,x)')))
7 5 3
64 x - 112 x + 56 x - 7 x
» pretty(simple(maple('P(6,x)')))
231 6 315 4 105 2
--- x - --- x + --- x - 5/16
16 16 16
» pretty(simple(maple('H(5,x)')))
5 3
32 x - 160 x + 120 x
» pretty(simple(maple('L(5,x)')))
2 3 4 5
1-5 x + 5 x - 5/3 x + 5/24 x - 1/120 x
Bessel and Airy Functions
The linearly independent solutions of the following second order differential equation are called Airy functions:
(Airy equation)
The linearly independent solutions of the following second order differential equation are called Bessel functions:
(Bessel equation)
The linearly independent solutions of the following differential equation are called modified Bessel functions:
(modified Bessel equation)
MATLAB implements the following related functions:
EXERCISE 3-8
Find the solutions of the differential equation
The equation is the Bessel differential equation with n = 1/2. We obtain two linearly independent solutions as follows:
» pretty(simple(maple('BesselJ(1/2,x)')))
1/2
2 sin(x)
----------
1/2 1/2
pi x
» pretty(simple(maple('BesselY(1/2,x)')))
1/2
2 cos(x)
- -----------
1/2 1/2
x pi