You are on page 1of 4

Applications of

Differential and Difference Equations


(MAT2002)
LAB

Experiment 9
Series Solution of Differential Equation about
x = 0 as an Ordinary Point

Department of Mathematics

Vellore Institute of Technology,


Vellore - 632014 (TN)

March 5, 2020
Series solution of Differential Equation Experiment 9

1 Aim

To find a series solution of an ordinary differential equation of second order using


Matlab

2 Mathematical Description

A real valued function f (x) of real variable x is said to be analytic at a point x = x0


if f possesses the derivatives of all orders in a small neighborhood N(x0 ) = (x0 −
h, x0 + h) of x0 . In this case, f can be represented by a Taylor series in N(x0 ). A
function f which is not analytic at x0 is said to be singular at that point.
Example 2.1.
Polynomial functions, sin x, cos x, ex and e−x are analytic at all points on the real
line and hence have the corresponding Taylor series representations.
Example 2.2.
The function f (x) = 1/(1 − x) is not defined and its derivatives fail to exist at
x = 0. Thus f is not analytic at x = 0.
Example 2.3.
If f (x) = x4/3 , then f (0) = f 0 (0) = 0 but f 00 (x) = −8x−5/3 /27 → ∞ as x → 0. Thus
f is not analytic at x = 0. However it is analytic at all other points on the real line.
Example 2.4.
If f (x) = sin x/ cos x is analytic at all points except x = nπ/2, n = ±1, ±2, ..., where
cos x = 0.

Regular Point
A point x0 on the real line is said to be a regular or ordinary point of a second
order differential equation

y00 + p(x)y0 + q(x)y = 0, (2.1)

if p(x) and q(x) are analytic at x0 , and every solution can be found as a power
series about x0 :

y= ∑ an (x − x0 )n , (2.2)
n=0

where the coefficients a0n s in practice, are determined through an appropriate


recurrence relation.

3 Matlab Code

Suppose we wish to find the general solution of


2
d y dy
a0 dx 2 + a1 dx + a2 y = Q(x), . (3.1)

ADDE(MAT2002) - ELA 1 Department of Mathematics


Series solution of Differential Equation Experiment 9

The matlab code is given as under:


clc
clear
syms x a0 a1 a2 a3
y= a0 + a1 *x + a2 *x ˆ 2 + a3 *x ˆ 3 ;
dy = d i f f ( y ) ;
d2y = d i f f ( dy ) ;
gde = c o l l e c t ( d2y−2*x ˆ 2 *dy + y , x ) ;
c o f = c o e f f s ( gde , x ) ;
A2= s o l v e ( c o f ( 1 ) , a2 ) ;
A3= s o l v e ( c o f ( 2 ) , a3 ) ;
y= subs ( y , { a2 , a3 } ,{ A2 , A3 } ) ;
y= c o e f f s ( y , [ a1 a0 ] ) ;
disp ( ' S o l u t i o n i s ' )
disp ( [ ' y=A ( ' , char ( y ( 1 ) ) , ' + . . . ) + B ( ' , char ( y ( 2 ) ) , ' + . . . ) ' ] )

Output
Solution i s
y=A( 1 − x ˆ 2 / 2 + . . . ) + B ( x − x ˆ 3 / 6 + . . . )

4 Self-check Exercises

Exercise 4.1.
Find the general power series solution as a series for the following:

(a) y00 − 2y0 − y = 0

(b) y00 + xy0 + y = 0

(c) y00 − 5xy0 + 6x2 y = 0

5 Concept-based Questions

Exercise 5.1.
Specify the conditions for the point x0 to be a regular point of the differential
equation (2.1), and hence write a matlab code to verify whether given x0 is an
ordinary point of each of the following:

(a) Hermite’s equation: y00 − 2xy0 + 2αy = 0with parameter α ∈ R; x = 0


 d2 y dy
(b) Legendre’s Differential Equation: 1 − x2 dx 2 − 2x dx + µ(µ + 1)y = 0 for all
−1 ≤ x ≤ 1, with parameter µ ∈ R; x = 0
 d2 y dy
(c) x2 − 25 dx 2 + 2x dx + y = 0; x = 1

ADDE(MAT2002) - ELA 2 Department of Mathematics


Series solution of Differential Equation Experiment 9

 d2 y dy
(d) x2 + 1 dx2
+ x dx − y = 0; x = 0

Exercise 5.2.
Using Matlab, find a general power series solution for each of the following, and
then compare with the corresponding closed form solution:
d2 y dy
(a) dx2
− 5 dx + 6y = 0
d2 y
(b) dx2
+ 25y = 0
d2 y dy
(c) dx2
− 4 dx + 4y = 0

ADDE(MAT2002) - ELA 3 Department of Mathematics

You might also like