Practical-1
Plotting of Legendre polynomial for n = 1 to 5 in the interval
[0,1]. Verifying graphically that all the roots of Pn(x) lie in the
interval [0,1]
Legendre’s Equation of order n :
1 - x 2 y'' - 2 xy' + n(n + 1) y = 0
General Equation :
y'' + P( x ) y ' + Q( x ) y = 0 or y '' - 12-xx 2 y' + n (n + 1 )
1- x 2
y = 0,
where P( x ) = - 12-xx 2 and Q( x ) = n (n + 1 )
1- x 2
Singular Points : x =
± 1 Putting coefficient of y '' = 0 ie. 1 - x 2 = 0
Singular Point : Points on which P(x) and Q(x) are not defined.
Ordinary Point : Points on which P(x) and Q(x) are defined.
Example :
1. y'' + xy' + 2 y = 0,
P( x ) = x and Q( x ) = 2 . These P( x ) and Q( x ) are defined
everywhere on R. Therefore x ∈ R is an ordinary point.
Types of Singular Point
2 Sem-5 [Link]
Types of Singular Point
Singular Point x0 is said to be Regular Singular Point if
f0 = x x0 ( x - x0 ) P ( x )
lim
: g0 =lim
x x 0 ( x - x 0 ) Q( x )
2
both exists. Otherwise that Singular
Point is said to be irregular Singular Point .
Series solution of a second order differential equation can be
found near ordinary points.
We use method of frobenius to find solution of second order
differential equation near Regular Singular Point.
In[ ]:= p1 = LegendreP[1, x]
Out[ ]= x
In[ ]:= Plot[p1, {x, 0, 1}]
1.0
0.8
0.6
Out[ ]=
0.4
0.2
0.2 0.4 0.6 0.8 1.0
In[ ]:= p2 = LegendreP[2, x]
- 1 + 3 x2
1
Out[ ]=
2
Sem-5 [Link] 3
In[ ]:= Plot[p2, {x, 0, 1}]
1.0
0.5
Out[ ]=
0.2 0.4 0.6 0.8 1.0
-0.5
In[ ]:= p3 = LegendreP[3, x]
- 3 x + 5 x3
1
Out[ ]=
2
In[ ]:= Plot[p3, {x, 0, 1}]
1.0
0.5
Out[ ]=
0.2 0.4 0.6 0.8 1.0
-0.5
In[ ]:= p4 = LegendreP[4, x]
3 - 30 x2 + 35 x4
1
Out[ ]=
8
4 Sem-5 [Link]
In[ ]:= Plot[p4, {x, 0, 1}]
1.0
0.8
0.6
0.4
Out[ ]=
0.2
0.2 0.4 0.6 0.8 1.0
-0.2
-0.4
In[ ]:= p5 = LegendreP[5, x]
15 x - 70 x3 + 63 x5
1
Out[ ]=
8
In[ ]:= Plot[p5, {x, 0, 1}]
1.0
0.8
0.6
0.4
Out[ ]=
0.2
0.2 0.4 0.6 0.8 1.0
-0.2
-0.4
In[ ]:= r = LegendreP[{1, 2, 3, 4, 5}, x]
x, - 1 + 3 x2 , - 3 x + 5 x3 , 3 - 30 x2 + 35 x4 , 15 x - 70 x3 + 63 x5
1 1 1 1
Out[ ]=
2 2 8 8
Sem-5 [Link] 5
In[ ]:= Plot[r, {x, 0, 1}]
1.0
0.5
Out[ ]=
0.2 0.4 0.6 0.8 1.0
-0.5
In[ ]:= Plot[LegendreP[{1, 2, 3, 4, 5}, x], {x, 0, 1}]
1.0
0.5
Out[ ]=
0.2 0.4 0.6 0.8 1.0
-0.5