Applied Mathematics and Computation 173 (2006) 683–693 www.elsevier.com/locate/amc
Approximate solution of general high-order linear nonhomogeneous difference equations by means of Taylor collocation method Mustafa Gu¨lsu *, Mehmet Sezer, Zekeriya Gu¨ney Department of Mathematics, Faculty of Science, Mugla University, Mugla, Turkey
Abstract In this paper, a Taylor collocation method is developed to find an approximate solution of general high-order linear nonhomogenous difference equations with variable coefficients under the mixed conditions. The solution is obtained in terms of Taylor polynomials about any point. Also, examples are presented which illustrate the pertinent features of the method. 2005 Elsevier Inc. All rights reserved. Keywords: Taylor polynomials; Difference equations; Collocation methods
1. Introduction Taylor and Chebyshev collocation methods for the approximate solutions of differential, integral and integrodifferential equations have been presented in many papers [1–4]. *
Corresponding author. E-mail address:
[email protected] (M. Gu¨lsu).
0096-3003/$ - see front matter 2005 Elsevier Inc. All rights reserved. doi:10.1016/j.amc.2005.04.048
684
M. Gu¨lsu et al. / Appl. Math. Comput. 173 (2006) 683–693
On the other hand, a Taylor expansions approach to solve high-order linear difference equations has been presented by Gu¨lsu and Sezer [5]. In this paper, these methods are developed and applied to the mth-order linear nonhomogenous difference equation with variable coefficients, which is given in [6, p. 174] and [7, p. 176], m X P k ðxÞyðx þ kÞ ¼ f ðxÞ; k P 0; k 2 N þ ð1Þ k¼0
with the mixed conditions p X
aij yðcj Þ ¼ li ;
a 6 cj ; x 6 b; i ¼ 0; 1; . . . ; m 1
ð2Þ
j¼0
and the solution is expressed as the Taylor polynomial yðxÞ ¼
N X y ðnÞ ðcÞ n ðx cÞ ; n! n¼0
a 6 x; c 6 b
ð3Þ
so that y(n)(c), n = 0, 1, . . . , N are the coefficients to be determined. Here Pk(x) and f(x) are functions defined on a 6 x 6 b; the real coefficients aij, cj and li are appropriate constants. 2. Fundamental matrix relations Let us first consider the desired solution y(x) of Eq. (1) defined by a truncated Taylor series (3). Then the solutions y(x) can be expressed in the matrix form ½yðxÞ ¼ XM0 A;
ð4Þ
where X ¼ ½ 1 ðx cÞ ðx cÞ2 . . . ðx cÞN ; A ¼ ½ y ð0Þ ðcÞ y ð1Þ ðcÞ . . . y ðN Þ ðcÞ T and 21
0!
60 6 6 60 6 6 M0 ¼ 6 . 6 6. 6 6 4. 0
0
0
.
.
.
1 1!
0 . . .
0 .
1 2!
. .
. .
0
0
. . .
.
.
.
.
0
3
07 7 7 07 7 7 . 7. 7 .7 7 7 .5 1 N!
M. Gu¨lsu et al. / Appl. Math. Comput. 173 (2006) 683–693
685
To obtain such a solution, we can use the following matrix method, which is a Taylor collocation method [1]. This method is based on computing the Taylor coefficients by means of the Taylor collocation points [1] and thereby finding the matrix A containing the unknown Taylor coefficients. Now we substitute the Taylor collocation points defined by xi ¼ a þ i
ba ; N
i ¼ 0; 1; . . . ; N
ð5Þ
into Eq. (1) to obtain m X P k ðxi Þyðxi þ kÞ ¼ f ðxi Þ.
ð6Þ
k¼0
Then we can write the system (6) in the matrix form m X Pk Yk ¼ F;
ð7Þ
k¼0
where 2
P k ðx0 Þ 6 0 6 6 6 . Pk ¼ 6 6 . 6 6 4 . 0
0 P k ðx1 Þ
. . . . . .
0 0
.
.
.
.
. 0
. . . . P k ðxN Þ
3 7 7 7 7 7; 7 7 7 5
2
YðiÞ
3 yðx0 þ kÞ 6 yðx þ kÞ 7 1 6 7 6 7 6 7 . 6 7; ¼6 7 . 6 7 6 7 4 5 . yðxN þ kÞ
2
3 f ðx0 Þ 6 f ðx Þ 7 1 7 6 6 7 6 . 7 6 7. F¼6 7 6 . 7 6 7 4 . 5 f ðxN Þ
Substituting the expression (x + k) instead of x into (3), we have N N X X y ðnÞ ðcÞ y ðnÞ ðcÞ n n ðx þ k cÞ ¼ ½ðx cÞ þ k n! n! n¼0 n¼0 N X n ðnÞ X n y ðcÞ nj ðx cÞ k j ¼ n! j n¼0 j¼0
yðx þ kÞ ¼
¼
N X n X n¼0
j¼0
kj y ðnÞ ðcÞðx cÞnj ðn jÞ!j!
and for x = xi, i = 0, 1, . . . , N yðxi þ hÞ ¼
N X n X n¼0
j¼0
kj y ðnÞ ðcÞðxi cÞnj . ðn jÞ!j!
ð8Þ
The matrix form of the expression (8) is obtained as ½yðxi þ kÞ ¼ X xi Mk A;
k ¼ 0; 1; . . . ; N ; i ¼ 0; 1; . . . ; N ;
ð9Þ
686
M. Gu¨lsu et al. / Appl. Math. Comput. 173 (2006) 683–693
where 2
X xi ¼ ½ 1 2 6 6 6 6 6 6 Mk ¼ 6 6 6 6 6 6 4
ðxi cÞ ðxi cÞ
1 0!0!
k1 0!1!
k2 0!2!
.
. .
0
1 1!0!
k1 1!1!
.
. .
0 .
0 .
1 2!0!
.
. .
.
.
.
. 0
. 0
. 0
.
... kN 0!N !
N ðxi cÞ ; 3
7
k N 2 7 2!ðN 2Þ! 7
7. 7 7 7 7 7 5
. . .
.
. .
7
k N 1 7 1!ðN 1Þ! 7
1 N !0!
From the matrix relation (9), for i = 0, 1, . . . , N, we get the matrix equation Yk ¼ CMk A; where 2
X x0
6X 6 x1 6 6 . C¼6 6 . 6 6 4 . X xN
3
ð10Þ 2
1
7 6 1 7 6 7 6 7 6 . 7¼6 7 6 6 7 6. 7 6 5 4.
1
ðx0 cÞ
ðx0 cÞ
2
.
. .
ðx1 cÞ
ðx1 cÞ2
.
. .
.
.
. .
. . 2
ðxN cÞ ðxN cÞ
ðx0 cÞ
N
3
7 ðx1 cÞN 7 7 7 . 7 7. 7 . 7 7 . 5 N . . ðxN cÞ
.
Then, we substitute the expression (10) into Eq. (7) and have the fundamental matrix equation ( ) m X Pk CMk A ¼ F. ð11Þ k¼0
Next we can obtain the corresponding matrix forms for the conditions (2) as follows. Using the relation (4), for x = cj the matrix [y(cj)] reduces to ½yðcj Þ ¼ X cj M0 A and thereby the matrix form of the conditions (2) becomes p X
aij X cj M 0 A ¼ ½li ;
ð12Þ
j¼0
where X ci ¼ ½1
ðcj cÞ
ðcj cÞ
2
N
. . . ðcj cÞ .
M. Gu¨lsu et al. / Appl. Math. Comput. 173 (2006) 683–693
687
Let us define Ui as Ui ¼
p X
aij X cj M 0 ½ui0 ui1 ; . . . ; uiN ;
i ¼ 0; 1; . . . ; m 1.
j¼0
Thus the matrix forms for conditions (2) become Ui A ¼ ½li ;
i ¼ 0; 1; . . . ; m 1.
ð13Þ
3. Method of solution The fundamental matrix Eq. (11) for Eq. (1) corresponds to a system of (N + 1) algebraic equations for the (N + 1) unknown coefficients y(0)(c), y(1)(c), . . . , y(N)(c). Briefly we can write (11) WA ¼ F or ½W; F
ð14Þ
so that W ¼ ½wnh ¼
m X
Pk CMk ;
h; n ¼ 0; 1; . . . ; N .
k¼0
We can write the corresponding matrix form (13) for the mixed conditions (2) in the augmented matrix form as ½ui ; li ¼ ½ui0 ui1 . . . uiN ; li ;
i ¼ 0; 1; . . . ; m 1.
ð15Þ
To obtain the approximate solution of Eq. (1) under the mixed conditions (2) in terms of Taylor polynomials, by replacing the m rows matrices (15) by the last m rows of the matrix (14), we have the required augmented matrix 3 2 w01 . . . w0N ; f ðx0 Þ w00 7 6 6 w10 w11 . . . w1N ; f ðx1 Þ 7 7 6 7 6 6 ... ... ... ; ... 7 7 6 7 6 6 wN m;0 wN m;1 . . . wN m;N ; f ðxN m Þ 7 7. ð16Þ ½W ; F ¼ 6 6 u u01 . . . u0N ; l0 7 7 6 00 7 6 6 u u11 . . . u1N ; l1 7 7 6 10 7 6 6 ... ... ... ; ... 7 5 4 um1;0
um1;1
. .
.
um1;N
;
lm1
If rank W ¼ rank½W ; F ¼ N þ 1, then we can write 1
A ¼ ðW Þ F
ð17Þ
688
M. Gu¨lsu et al. / Appl. Math. Comput. 173 (2006) 683–693
and thus the matrix A (thereby the coefficients y(n)(c), n = 0 ,1, . . . , N) is uniquely determined. Thus the linear difference Eq. (1) with conditions (2) has a unique solution. This solution is given by the Taylor polynomial solution (3). Also, by means of system (14), we may find the particular solutions. We can easily check the accuracy of this solution as follows [1,2]. Since the obtained polynomial expansion is an approximate solution of Eq. (1), when the function y(x) and its derivatives are substituted in Eq. (1), the resulting equation must be satisfied approximately; that is, for x = xi 2 [a, b], i = 0, 1, 2, . . . , X m Eðxi Þ ¼ P k ðxi Þyðxi þ kÞ f ðxi Þ ffi 0 k¼0 or Eðxi Þ 6 10ki k i
ðk i is any positive integerÞ. k
If max j10 j ¼ 10 (k is any positive integer) is prescribed, then the truncation limit N is increased until the difference E(xi) at each of the points becomes smaller then the prescribed 10k.
4. Illustration The method of this study is useful in finding the solutions of linear difference equations with variable coefficients in terms of Taylor polynomials. We illustrate it by the following examples. Example 1. Let us first consider the linear second-order difference equation ðx 1Þyðx þ 2Þ þ ð2 3xÞyðx þ 1Þ þ 2xyðxÞ ¼ 1 with y(0) = 2 and y(1) = 2, 0 6 x 6 2 and approximate the solution y(x) by the Taylor polynomial yðxÞ ¼
5 X y ðnÞ ð0Þ n x; n! n¼0
where a = 0, b = 2, c = 0, P0(x) = 2x, P1(x) = (2 3x), P2(x) = x 1, f(x) = 1. Then, for N = 5, the collocation points x0 ¼ 0;
2 x1 ¼ ; 5
4 x2 ¼ ; 5
6 x3 ¼ ; 5
8 x4 ¼ ; 5
and the matrix form of the problems defined by ðP2 CM2 þ P1 CM1 þ P0 CM0 ÞA ¼ F;
x5 ¼ 2
M. Gu¨lsu et al. / Appl. Math. Comput. 173 (2006) 683–693
689
where P0, P1, P2, C, M0, M1, M2 are matrices of order (6 · 6) defined by 3 0 07 7 7 07 7; 07 7 7 05
2
0 0 0 0 0 6 0 0.8 0 0 0 6 6 6 0 0 1.6 0 0 P0 ¼ 6 60 0 0 2.4 0 6 6 40 0 0 0 3.2
0 0 0 0 0 4 1 0 0 0 0 6 0 0.6 0 0 0 6 6 6 0 0 0.2 0 0 P2 ¼ 6 6 0 0 0 0.2 0 6 6 4 0 0 0 0 0.6 2
0
2
0
0
0
1
1 2
1 6
1 24
1 3 120
1
1
1 2
1 6
1 24
0
1 2
1 2
1 4
1 12
0
0
1 6
1 6
1 12
0
0 0
1 24
1 24
0
0
0 0
0
1 120
1
0
0 0
0
0
1
0 0
0
0
1 2
0
0
0
0
1 6
0
0
0 0
1 24
0
0 0
0
1
6 60 6 6 60 M1 ¼ 6 60 6 6 60 4 2
0
6 60 6 6 60 M0 ¼ 6 60 6 6 60 4 0
7 7 7 7 7 7; 7 7 7 7 5
2 0 0 0 0 6 0 0.8 0 0 0 6 6 6 0 0 0.4 0 0 P1 ¼ 6 60 0 0 1.6 0 6 6 40 0 0 0 2.8 0
3
0
7 0 7 7 7 0 7 7; 0 7 7 7 0 7 5 1 120
0
0
4
0
0 07 7 7 07 7; 07 7 7 05 1
2
1
6 60 6 6 60 M2 ¼ 6 60 6 6 60 4 0
3
3 0 0 7 7 7 0 7 7; 0 7 7 7 0 5
2
2
1
6 61 6 6 61 C¼6 61 6 6 61 4 1
3
2
2
4 3
2 3
4 15
1
2 2
4 3
2 3
0
1 2
1
1
2 3
0
0
1 6
1 3
1 3
0
0 0
1 24
1 12
0
0 0
0
1 120
0
0
0
0
2 5
4 25
8 125
16 625
4 5
16 25
64 125
256 625
6 5
36 25
216 125
1296 625
8 5
64 25
512 125
4096 625
2
4
8
16
7 7 7 7 7 7; 7 7 7 7 5
0
3
7 7 7 1024 7 3125 7 7. 7776 7 3125 7 7 32768 7 3125 5 32 3125
32
The augmented matrix forms of the conditions for N = 5 are ½1 ½1
0 0 0 0 0 ; 2 1 1=2 1=6 1=24 1=120
; 2 .
Taking N = 5, we obtain the approximate solution. The solution is yðxÞ ¼ 2 0.293098x þ 0.205756x2 þ 0.088237x3 0.005369x4 þ 0.004474x5 .
Taking N = 7, the solutions obtained are compared with the results given by Gu¨lsu and Sezer [5] and the exact solution y(x) = 2x x + 1 [7] in Table 1.
690
M. Gu¨lsu et al. / Appl. Math. Comput. 173 (2006) 683–693
Table 1 Error analysis of Example 1 for the x value x
0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
Present method N=5
N=7
N=9
2.000000 1.950309 1.921237 1.916924 1.941649 2.000000 2.097044 2.238505 2.430927 2.681855 3.000000
2.000000 1.948724 1.919528 1.915727 1.941105 2.000000 2.097393 2.239009 2.431425 2.682196 3.000000
2.000000 1.948698 1.919508 1.915716 1.941101 2.000000 2.097396 2.239015 2.431433 2.682202 3.000000
Exact solution
Taylor matrix method
2.000000 1.948698 1.919507 1.915716 1.941101 2.000000 2.097396 2.239015 2.431433 2.682202 3.000000
2.000000 1.948698 1.919508 1.915717 1.941101 2.000000 2.097396 2.239016 2.431433 2.682202 3.000000
Example 2. Let us consider the first-order difference equation yðx þ 1Þ yðxÞ ¼ ex ;
06x61
with y(1/2) = 1, and approximate the solution y(x) by the truncated Taylor series in the form yðxÞ ¼
6 X y ðnÞ ð0Þ n x n! n¼0
so that a = 0, b = 1, c = 0, P0(x) = 1, P1(x) = 1 and f(x) = ex. For N = 6, the collocation points x0 ¼ 0;
1 x1 ¼ ; 6
1 x2 ¼ ; 3
1 x3 ¼ ; 2
2 x4 ¼ ; 3
5 x5 ¼ ; 6
x6 ¼ 1
and the matrix form of the problems defined by ðP1 CM1 þ P0 CM0 ÞA ¼ F. After the augmented matrices of the system and conditions are computed, we obtain the new augmented matrix in the form 2
0 1 0.5 0.166666 6 60 1 0.666667 0.263888 6 6 6 0 0.999999 0.833333 0.388888 6 6 1 1 0.541666 ½W ;F ¼ 6 60 6 60 1 1.166666 0.722222 6 6 6 0 0.999999 1.333333 0.930555 4 1
1 2
1 8
1 48
0.041666 0.008333 0.001388 ;
1
3
7 0.077160 0.018010 0.003502 ; 1.181360 7 7 7 0.131172 0.035082 0.007801 ; 1.395612 7 7 7 0.208333 0.063020 0.015798 ; 1.648721 7 7. 7 0.313271 0.106069 0.029646 ; 1.947734 7 7 7 0.450617 0.169245 0.052271 ; 2.300975 7 5 1 384
1 3840
1 46080
;
1
M. Gu¨lsu et al. / Appl. Math. Comput. 173 (2006) 683–693
691
This system has the solution A¼
½0.6224674096 0.5820072806
0.5826745232
0.5675538869
0.6925308020
0.130632887
1.525741808
T
.
Therefore, we find the solution yðxÞ ¼ 0.6224674096 þ 0.5820072806x þ 0.2913372616x2 þ 0.09459231449x3 þ 0.02885545008x4 þ 0.001088607392x5 þ 0.002119085844x6 . The values of this solution are compared with the results forpN ffiffiffi = 7 given by Gu¨lsu and Sezer [5] and the exact solution yðxÞ ¼ ðe 1 e þ ex Þ=ðe 1Þ [7] in Table 2. Example 3. Let us consider the linear difference equation 2yðx þ 1Þ yðxÞ ¼ 1;
06x61
pffiffiffi with mixed condition yð0Þ þ yð1=2Þ ¼ 2. For N = 5, the collocation points x0 ¼ 0;
1 x1 ¼ ; 5
2 x2 ¼ ; 5
3 x3 ¼ ; 5
4 x4 ¼ ; 5
x5 ¼ 1
and the matrix form of the problem is defined by ðP1 CM1 þ P0 CM0 ÞA ¼ F. After the augmented matrices of the systems and conditions are computed, we obtain this solution yðxÞ ¼ 1.000008468 þ 1.386246251x 0.4797058170x2 þ 0.1089472514x3 0.01689103486x4 þ 0.001407584849x5 . Table 2 Error analysis of Example 2 for the x value x
Present method N=6
E(xi)
N=7
E(xi)
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
0.62246 0.68367 0.75132 0.82608 0.90869 0.99999 1.10090 1.21243 1.33569 1.47191 1.62246
0.807E5 0.126E4 0.151E4 0.128E4 0.686E5 0.100E9 0.500E5 0.640E5 0.384E5 0.164E5 0.807E5
0.62245 0.68366 0.75130 0.82606 0.90868 1.00000 1.10091 1.21243 1.33569 1.47191 1.62245
0.313E5 0.254E5 0.161E5 0.626E6 0.190E8 0.000000 0.608E6 0.157E5 0.253E5 0.312E5 0.313E5
Exact solution
Taylor matrix method
0.62245 0.68366 0.75131 0.82606 0.90868 1.00000 1.10091 1.21243 1.33569 1.47191 1.62245
0.62245 0.68366 0.75131 0.82606 0.90869 1.00000 1.10091 1.21243 1.33569 1.47190 1.62245
692
M. Gu¨lsu et al. / Appl. Math. Comput. 173 (2006) 683–693
Table 3 Error analysis of Example 3 for the x value x
Exact solution
N=5 E(xi)
N=6 E(xi)
N=7 E(xi)
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
1.000000 0.866065 0.741101 0.624504 0.515716 0.414213 0.319507 0.231144 0.148698 0.071773 0.000000
0.8468E5 0.7645E5 0.1320E5 0.4855E5 0.8296E5 0.8469E5 0.6081E5 0.2412E5 0.1172E5 0.3587E5 0.4232E5
0.1500E7 0.5455E6 0.9943E6 0.1047E6 0.7503E6 0.2856E6 0.1453E6 0.4016E6 0.4242E6 0.2396E6 0.6022E7
0.8120E7 0.8700E7 0.5820E7 0.4200E8 0.4890E7 0.8120E7 0.8210E7 0.5800E7 0.1890E7 0.1778E7 0.4072E7
The errors obtained with the exact solution y(x) = 2(1x) + 1 [7, p. 122] are given in Table 3. Example 4. Our last example is the linear difference equation with variable coefficients ðx þ 1Þyðx þ 2Þ ð2x þ 3Þyðx þ 1Þ þ xyðxÞ ¼ x2 with y(0) = 1/4, y(1) = 3/4 and approximate the solution y(x) by the truncated Taylor series (N = 4). The system has the solution T 0 1 0 0 . A ¼ 1 4 Therefore, we find the exact solution [7, p. 201] yðxÞ ¼
x2 1 . 4 2
5. Conclusions High order difference equations are usually difficult to solve analytically. Then it is required to obtain the approximate solutions. For this reason, the present method has been proposed for approximate solution and also analytical solution. The method presented in this study is a method for computing the coefficients in the Taylor expansion of the solution of a linear difference equation, and is valid when the functions Pk(x) and f(x) are defined [a, b]. The Taylor collocation method is an effective method for the cases that the known functions have the Taylor series expansions at x = c are defined on
M. Gu¨lsu et al. / Appl. Math. Comput. 173 (2006) 683–693
693
a 6 x, t 6 b. In this case, the Taylor polynomial solution yi(x), i = 1, 2, . . . , k and the values yi(xj), a 6 xj 6 b can be easily evaluated at low-computation effort. In addition, an interesting feature of this method is to find the analytical solutions if the equation has an exact solution that is a polynomial of degree N or less than N. The method can also be extended to the differential-difference equation with variable coefficients, but some modifications are required.
References [1] A. Karamete, M. Sezer, A Taylor collocation method for the solution of linear integrodifferential equations, Int. J. Comput. Math. 79 (9) (2002) 987–1000. [2] M. Sezer, A. Karamete, M. Gu¨lsu, Solutions of systems of linear differential equations with variable coefficients, Int. J. Comput. Math., in press. [3] A. Akyu¨z, M. Sezer, A Chebyshev collocation method for the solution of linear integro differential equation, Int. J. Comput. Math. 72 (4) (1999) 491–507. [4] A. Akyu¨z, M. Sezer, Chebyshev polynomial solutions of systems of high-order linear differential equations with variable coefficients, Appl. Math. Comput. 144 (2003) 237–247. [5] M. Gu¨lsu, M. Sezer, The approximate solution of high-order linear difference equations with variable coefficients in terms of Taylor polynomials, Appl. Math. Comput., in press, doi: 10.1016/j.amc.2004.08.043. [6] T.L. Saaty, Modern Nonlinear Equations, Dover Publications Inc., New York, 1981. [7] H. Levy, F. Lessman, Finite Difference Equations, The Macmillan Company, New York, 1961.