Sie sind auf Seite 1von 10

Applied Mathematics and Computation 151 (2004) 869–878

www.elsevier.com/locate/amc

Lagrange interpolation to compute


the numerical solutions of differential,
integral and integro-differential equations
M.T. Rashed
Faculty of Science, Department of Mathematics, South Valley University, Sohag 82524, Egypt

Abstract
This paper describes new two methods for the numerical solution of linear integral
equations of Fredholm type and Volterra type. Also, the methods have been extended to
linear integro-differential and differential equations. The methods are tested by different
examples.
Ó 2003 Elsevier Inc. All rights reserved.

Keywords: Lagrange interpolation; Integro-differential equations; Integral equations and differen-


tial equations

1. Introduction

Lagrange interpolation of the function yðxÞ is given by


X
n
yðxÞ  lj ðxÞyðxj Þ; A6x6B ð1:1Þ
j¼0

where
n 
Y 
x  xk
lj ðxÞ ¼
xj  xk
k¼0
k 6¼ j

E-mail addresses: taha_123452002@yahoo.com, taha_123452002@hotmail.com (M.T. Rashed).

0096-3003/$ - see front matter Ó 2003 Elsevier Inc. All rights reserved.
doi:10.1016/S0096-3003(03)00543-5
870 M.T. Rashed / Appl. Math. Comput. 151 (2004) 869–878

Integrating both side of (1.1) from A to x


Z x X
n
yðtÞ dt  bj ðxÞyðxj Þ ð1:2Þ
A j¼0

where
Z x n 
Y 
x  xk
bj ðxÞ ¼ dt ð1:3Þ
A xj  xk
k¼0
k 6¼ j

The integral in (1.3) may be computed approximated [3, p. 33] as follows


Z !
xA 1 Y n ðxAÞtþðxþAÞ
2
 x k
bj ðxÞ ¼ dt
2 1 xj  xk
k¼0
k 6¼ j
! ð1:4Þ
xA X Y
N n ðxAÞts þðxþAÞ
2
 xk
bj ðxÞ ¼ ds
2 s¼0 xj  xk
k¼0
k 6¼ j

where
 
2ds X
N
00 ksp
ds ¼ Ik cos
N k N

8
> 2; k¼0
<
Ik ¼ 0; k is odd
: 2 ;
>
k is even
1  k2
Also,
R x R x with using Lagrange interpolation, we can find the indefinite integral
A A
yðtÞ dt dx
Z x Z x Z x X
n
yðtÞ dt dx ¼ ðx  tÞyðtÞ dt  Cj ðxÞyj ð1:5Þ
A A A j¼0

Z x
Cj ðxÞ ¼ ðx  tÞlj ðtÞ dt
A
Z     Y
n  xA 
xA 1 xA xþA 2
t þ xþA
2
 xk
¼ x t dt
2 1 2 2 xj  xk
k¼0
k 6¼ j
M.T. Rashed / Appl. Math. Comput. 151 (2004) 869–878 871
  N    
xA X xA xþA
¼ ds x  ts 
2 s¼0
2 2
Yn  xA xþA 
ts þ
2
 xk
2

xj  xk
k¼0
k 6¼ j
 sp 
ts ¼ cos ; s ¼ 0ð1ÞN
N

2. Method 1

Consider linear Volterra integral equations of the second kind


Z x
yðxÞ þ k kðx; tÞyðtÞ dt ¼ gðxÞ; A 6 x 6 B ð2:1Þ
A
which may be approximated by
Xn
flj ðxÞ þ kkðx; tj Þbj ðxÞgyj ¼ gðxÞ; A6x6B ð2:2Þ
j¼0

where bj ðxÞ is defined by the relation (1.4) and xj ¼ cosðjp=nÞ, j ¼ 0ð1Þn or


xj ¼ A þ jh, h ¼ ðB  AÞ=n, j ¼ 0ð1Þn. The main advantages of Lagrange in-
terpolation than Chebyshev interpolation is the first gives the numerical so-
lution at an equal intervals.
Chebyshev interpolation for yðxÞ is given by
X n
yðxÞ  lj ðxÞyðxj Þ; 1 6 x 6 1
j¼0

where
 
2dj X n
00 kjp
lj ðxÞ ¼ Tk ðxÞ cos
n k¼0 n
 
jp
xj ¼ cos ; j ¼ 0ð1Þn
n

0:5; j ¼ 0; n
dj ¼
1; 0<j n
Fredholm integral equation of the second kind
Z B
yðxÞ þ k kðx; tÞyðtÞ dt ¼ gðxÞ; A 6 x 6 B ð2:3Þ
A
is represented by
X
n
flj ðxÞ þ kkðx; tj Þbj ð1Þgyj ¼ gðxÞ ð2:4Þ
j¼0
872 M.T. Rashed / Appl. Math. Comput. 151 (2004) 869–878

3. Method 2

Integral equation (2.1) is approximated by


Xn
flj ðxÞ þ kBðx; tj Þgyj ¼ gðxÞ ð3:1Þ
j¼0

where
Z x X
N
Bðx; xj Þ ¼ kðx; tÞlj ðtÞ dt  kðx; tk Þlj ðtk Þbk ðxÞ ð3:2aÞ
A k¼0

or
Z   n  xA 
xA 1
xA xþA Y 2
t þ xþA
2
 xk
Bðx; tj Þ ¼ k x; tþ dt
2 1 2 2 xj  xk
k¼0
k 6¼ j
 X
N  Y
n  xA 
xA xA xþA ts þ xþA  xk
2 2
 ds k x; ts þ
2 s¼0
2 2 xj  xk
k¼0
k 6¼ j

ð3:2bÞ
where
 sp 
ts ¼ cos ; s ¼ 0ð1ÞN
N
Also, the last two methods must be used to treat linear Volterra integral
equations of the first kind
Z x
kðx; tÞyðtÞ dt ¼ gðxÞ; A 6 x 6 B ð3:3Þ
A

as follows, Eq. (3.3) is approximated by (method 1)


X
n
kðzi ; tj Þbj ðzi Þyj ¼ gðzi Þ; i ¼ 0ð1Þn ð3:4Þ
j¼0

where
 
BA ði  0:45Þp AþB
zi ¼ cos þ ; i ¼ 0ð1Þn
2 n 2
and
BA
yj ¼ yðtj Þ; tj ¼ A þ jh; h¼ ; j ¼ 0ð1Þn
n
On the other hand, with using method 2 integral equation (3.3) are approxi-
mated by
M.T. Rashed / Appl. Math. Comput. 151 (2004) 869–878 873

X
n
Bðzi ; tj Þyj ¼ gðzi Þ; i ¼ 0ð1Þn ð3:5Þ
j¼0
where Bðzi ; tj Þ, i; j ¼ 0ð1Þn are given by (3.2b).

4. Linear integro-differential equations

Consider linear integro-differential equations of the second order


Z x
 0 00

w1 x; y; y ; y þ k kðx; tÞw2 ðt; y; y 0 ; y 00 Þ dt ¼ gðxÞ
A ð4:1Þ
yðAÞ ¼ a; y 0 ðAÞ ¼ b
where
 
w1 x; yðxÞ; y 0 ðxÞ; y 00 ðxÞ ¼ A1 ðxÞy 00 ðxÞ þ A2 ðxÞy 0 ðxÞ þ A3 ðxÞyðxÞ
 
w2 t; y; y 0 ; y 00 ¼ A4 ðtÞy 00 ðtÞ þ A5 ðtÞy 0 ðtÞ þ A6 ðtÞyðtÞ
Let y 00 ðxÞ has the Lagrange expansion
X n
y 00 ðxÞ  yj00 lj ðxÞ; A 6 x 6 B ð4:2Þ
j¼0
X
n
y 0 ðxÞ  y 0 ðAÞ þ yj00 bj ðxÞ; A6x6B ð4:3Þ
j¼0

and
X
n
yðxÞ  yðAÞ þ ðx  AÞy 0 ðAÞ þ yj00 Cj ðxÞ; A6x6B ð4:4Þ
j¼0

Substitute from (4.2)–(4.4) in (4.1) we get


X n
Bj ðxÞyj00 ¼ GðxÞ ð4:5Þ
j¼0

where
Z x
Bj ðxÞ ¼ A1 ðxÞlj ðxÞ þ A2 ðxÞbj ðxÞ þ A3 ðxÞCj ðxÞ þ k kðx; tÞfA4 ðtÞlj ðtÞ
A

þ A5 ðtÞbj ðtÞ þ A6 ðtÞCj ðtÞg dt


and
GðxÞ ¼ gðxÞ  A2 ðxÞy 0 ðAÞ  A3 ðxÞ½yðAÞ þ ðx  AÞy 0 ðAÞ
Z x Z x
0
k kðx; tÞy ðAÞ dt  k kðx; tÞ½yðAÞ þ ðt  AÞy 0 ðAÞ dt
A A

Hence, using (4.4) to find the solution of integro-differential equation (4.1) at


the points x1 ¼ A þ ih, i ¼ 0ð1Þn, h ¼ ðB  AÞ=n. Also, the last methods can be
extended to integro-differential equations of the first kind
874 M.T. Rashed / Appl. Math. Comput. 151 (2004) 869–878
Z x
kðx; tÞy 00 ðtÞ dt ¼ gðxÞ
A

which may be approximated by


X
n
kðzi ; tj Þyj00 bj ðzi Þ ¼ gðzi Þ; i ¼ 0ð1Þn
j¼0

5. Numerical examples

(i) Volterra integral equations of the second kind


Z x
yðxÞ þ k kðx; tÞyðtÞ dt ¼ gðxÞ
A

2 kx  x2 2
 2
ð1Þ kðx; tÞ ¼ xt; gðxÞ ¼ ex  e  eA ; yðxÞ ¼ ex
2
2 þt2 2
 2 2

ð2Þ kðx; tÞ ¼ ex ; gðxÞ ¼ 2x þ kex ex  eA ; yðxÞ ¼ 2x

(ii) Fredholm integral equations of the second kind


Z B
yðxÞ þ k kðx; tÞyðtÞ dt ¼ gðxÞ
A

ð3Þ kðx; tÞ ¼ ext ; gðxÞ ¼ ex þ kex ðB  AÞ; yðxÞ ¼ ex


rn , the computed errors:

n Examples
1 2 3
Method 1 Method 2 Method 1 Method 2 Method 1 Method 2
2 2.9D)03 3.2D)03 3.8D)02 5.3D)04 3.5D)16 6.4D)04
3 1.0D)03 4.1D)05 5.3D)03 1.8D)05 5.3D)16 9.2D)05
4 3.8D)05 4.2D)05 8.5D)04 5.1D)07 6.8D)16 1.4D)06
5 1.9D)05 2.3D)06 1.4D)04 1.2D)08 2.9D)16 1.6D)07
6 8.3D)07 6.0D)07 2.2D)05 2.4D)10 2.7D)16 2.3D)09
7 3.5D)07 5.8D)08 3.6D)06 4.3D)12 3.0D)16 2.1D)10
8 2.1D)08 8.1D)09 5.6D)07 6.8D)14 6.8D)16 2.7D)12
9 5.5D)09 1.1D)09 8.7D)08 7.9D)15 2.8D)16 1.9D)13
10 4.8D)10 9.4D)11 1.2D)08 1.5D)14 4.7D)16 1.9D)14
Z p=2
1 x p
ð4Þ yðxÞ  xtyðtÞ dt ¼ sinðxÞ  ; yðxÞ ¼ sin x; 06x6
4 0 2 2
Source [4].
M.T. Rashed / Appl. Math. Comput. 151 (2004) 869–878 875
Z 1
ð5Þ yðxÞ ¼ x2 þ kðx; tÞyðtÞ dt
0
(
tð1  xÞ; t 6 x
kðx; tÞ ¼
xð1  tÞ; t > x
yðxÞ ¼ A1 ex þ B1 ex  2:0
3e  2 eð2e  3Þ
A1 ¼ ; B1 ¼
e2  1 e2  1
rn , the computed errors:

n Examples
4 5
Method 1 Method 2 Trapezium Simpson Method 1 Method 2
2 3.3D)03 3.3D)03 2.6D)02 3.3D)03 1.1D)02 4.6D)05
3 1.3D)03 3.7D)04 9.9D)03 1.7D)04 9.5D)06
4 1.7D)05 1.7D)05 5.2D)03 1.6D)04 3.5D)05 9.1D)08
5 9.4D)06 1.6D)06 3.2D)03 4.4D)07 1.4D)08
6 6.9D)08 6.9D)08 2.2D)03 2.9D)05 7.7D)08 1.1D)10
7 4.2D)08 4.9D)09 1.6D)03 7.7D)08 1.4D)11
8 1.9D)10 1.9D)10 1.2D)03 9.1D)06 1.1D)10 1.1D)13
9 1.3D)10 1.1D)11 9.2D)04 9.3D)13 9.8D)15
10 4.1D)13 4.1D)13 7.4D)04 3.7D)06 1.1D)13 1.7D)15

(iii) Volterra integral equations of the first kind


Z x
kðx; tÞyðtÞ dt ¼ gðxÞ
0

ð6Þ kðx; tÞ ¼ cosðx  tÞ; gðxÞ ¼ x sinðxÞ; yðxÞ ¼ 2 sinðxÞ


ð7Þ kðx; tÞ ¼ cosðx  tÞ; gðxÞ ¼ sinðxÞ; yðxÞ ¼ 1:0
Source [2].
(iv) Fredholm integral equations of the first kind
Z 1
ð8Þ kðx; tÞyðtÞ dt ¼ gðxÞ
0

tðx  1Þ; t 6 x
kðx; tÞ ¼
xðt  1Þ; t > x
gðxÞ ¼ e þ ð1  eÞx  1:0; yðxÞ ¼ ex
x

Source [1].
876 M.T. Rashed / Appl. Math. Comput. 151 (2004) 869–878

rn , the computed errors:

n Examples
6 7 8
Method 1 Method 2 Method 1 Method 2 Method 1 Method 2
2 1.2D)01 5.2D)02 9.7D)04 6.3D)04 1.1D)01 2.2D)02
3 9.6D)03 3.4D)03 1.2D)03 2.1D)04 9.9D)03 1.5D)03
4 1.6D)03 2.8D)04 9.5D)06 5.8D)07 6.2D)04 7.7D)05
5 8.4D)05 6.7D)06 2.4D)06 7.1D)08 3.1D)05 3.2D)06
6 8.9D)06 5.5D)07 1.6D)08 1.2D)10 1.3D)06 1.2D)07
7 3.6D)07 9.3D)09 2.5D)09 2.9D)11 4.5D)08 3.6D)09
8 2.9D)08 5.6D)10 1.6D)12 4.9D)13 1.4D)09 9.9D)11
9 1.0D)09 7.4D)12 1.7D)12 4.6D)13 3.9D)11 8.4D)11
10 6.5D)11 5.4D)13 2.4D)14 8.1D)13 2.9D)12 1.3D)10

Z 1
ð9Þ kðx; tÞyðtÞ dt ¼ gðxÞ
0

tðx  1Þ; t 6 x
kðx; tÞ ¼
xðt  1Þ; t > x
3
x x
gðxÞ ¼ ; yðxÞ ¼ x
6

Source [1].
(v) Volterra integro-differential equations of the second kind
Z x
x2  2
ð10Þ y 00  y 0 þ yþk ½y 00 ðtÞ þ y 0 ðtÞ  tyðtÞ dt ¼ gðxÞ; 1 6 x 6 1
2 A
yðAÞ ¼ A; y 0 ðAÞ ¼ 1:0
xðx2  2Þ  2 ðx3  A3 Þ
gðxÞ ¼ þ kðx  AÞ  k ;
2 3:0
k ¼ 1:0; k ¼ 0:0; yðxÞ ¼ x

Z x
ð11Þ y 00 þ xex y 0 þ y þ k exþt yðtÞ dt ¼ gðxÞ; 06x61
A
yðAÞ ¼ eA ; y 0 ðAÞ ¼ eA
gðxÞ ¼ 2ex  x þ kðx  AÞex ;
yðxÞ ¼ ex ; k ¼ 1:0; k ¼ 0:0;
M.T. Rashed / Appl. Math. Comput. 151 (2004) 869–878 877

rn , the computed errors:

n Examples
9 10 11
Method 1 Method 2 k¼1 k¼0 k¼1 k¼0
2 9.2D)16 2.8D)15 3.7D)18 0.0D + 0.0 3.1D)03 4.4D)04
3 2.1D)15 7.7D)15 1.5D)15 7.1D)17 2.5D)04 1.0D)04
4 7.7D)15 5.9D)15 9.3D)18 0.0D + 0.0 8.7D)06 1.0D)06
5 2.5D)14 7.8D)14 3.1D)16 1.1D)16 3.7D)07 3.1D)08
6 8.1D)15 8.8D)14 6.8D)17 2.5D)18 1.8D)08 1.6D)09
7 1.8D)14 1.2D)12 2.3D)16 2.0D)16 6.1D)10 4.8D)11
8 4.1D)14 6.8D)13 4.4D)17 0.0D + 0.0 2.5D)11 1.8D)12
9 3.7D)14 2.4D)11 6.9D)16 2.3D)16 7.2D)13 5.2D)14
10 1.1D)13 6.8D)13 9.3D)18 5.8D)20 2.5D)14 1.6D)15

ð12Þ y 00 ðxÞ þ ðx2 þ x þ 1Þy 0 ðxÞ þ ðx þ 2ÞyðxÞ ¼ gðxÞ; 06x61


0
yð0Þ ¼ 1; y ð0Þ ¼ 1:0
2
gðxÞ ¼ ðx þ 2x þ 4Þex ; yðxÞ ¼ ex
Z x
ð13Þ cosðx  tÞy 00 ðtÞ dt ¼ 2 sinðxÞ; 06x61
0
yð0Þ ¼ 0:0; y 0 ð0Þ ¼ 0:0
yðxÞ ¼ x2

n Examples
12 13
Method 1 Method 2
2 5.2D)04 3.6D)04 8.4D)05
3 3.4D)04 1.6D)04 1.7D)05
4 1.4D)06 6.0D)07 2.4D)08
5 1.7D)07 2.2D)07 2.6D)09
6 2.4D)09 1.1D)09 2.9D)12
7 1.3D)10 2.6D)10 6.7D)13
8 2.8D)12 1.3D)12 7.8D)16
9 9.8D)14 2.3D)13 4.4D)16
10 2.4D)15 9.9D)16 5.3D)16
878 M.T. Rashed / Appl. Math. Comput. 151 (2004) 869–878

6. Conclusions

(1) The suggested methods give the solutions at the points xj ¼ cosðjp=nÞ,
j ¼ 0ð1Þn or xj ¼ A þ jh, j ¼ 0ð10Þn, h ¼ ðB  AÞ=n.
(2) The suggested methods treat Volterra integral equations of the first kind
and integro-differential equations of the first kind (see examples 6, 7 and
13).
(3) The suggested methods can be applied to Fredholm integral equations of
the second kind and of the first kind (see examples 3–5, 8 and 9).
(4) The formulae written in the convenient form of FORTRAN subroutines
which can be run on a personal computer.
(5) The very rapid convergence obtained shows that the suggested methods, in-
deed successfully treat Volterra type and Fredholm type without any prob-
lems.
(6) Example 5 has GreenÕs function kernel with ‘‘benign’’ singularities [3].
(7) The computed errors rn are defined by
" #1=2 Z 1=2
X
n 1
rn ¼ e2n ðxj Þ=n  e2n ðtÞ dt
j¼0 1

where xj ¼ A þ jh, j ¼ 0ð1Þn, h ¼ ðB  AÞ=n and en ¼ yn  yexact .


(8) Also, the methods can be applied to find the solutions of integro-differen-
tial equations with boundary conditions.

References

[1] E. Baolian, L.M. Delves, An augmented Galerkin matrix for the first integral equations, J. Inst.
Math. Appl. (1979) 157–174.
[2] C.T.H. Baker, The Numerical Treatment of Integral Equations, Clarendon press, Oxford, 1977.
[3] L.M. Delves, J.L. Mohamed, Computational Methods for Integral Equations, Cambridge
University Press, New York, 1985.
[4] L.M. Delves, J. Walsh, Numerical Solution of Integral Equations, Oxford University Press,
London, New York, 1974.

Das könnte Ihnen auch gefallen