APPMATHISRN Applied Mathematics2090-55722090-5564International Scholarly Research Network78769410.5402/2011/787694787694Research ArticleApproximate Solutions of Differential Equations by Using the Bernstein PolynomialsOrdokhaniY.1Davaei farS.1DingF.PsihoyiosG.1Department of MathematicsAlzahra UniversityTehranIranalzahra.ac.ir201130052011201112032011190420112011Copyright © 2011 Y. Ordokhani and S. Davaei far.This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

A numerical method for solving differential equations by approximating the solution in the Bernstein polynomial basis is proposed. At first, we demonstrate the relation between the Bernstein and Legendre polynomials. By using this relation, we derive the operational matrices of integration and product of the Bernstein polynomials. Then, we employ them for solving differential equations. The method converts the differential equation to a system of linear algebraic equations. Finally some examples and their numerical solutions are given; comparing the results with the numerical results obtained from the other methods, we show the high accuracy and efficiency of the proposed method.

1. Introduction

In recent years, the Bernstein polynomials (B-polynomials) have attracted the attention of many researchers. These polynomials have been utilized for solving different equations by using various approximate methods. For instance, B-polynomials have been used for solving Fredholm integral equations [1, 2], Volterra integral equations , differential equations , and integro-differential equations . Singh et al.  and Yousefi and Behroozifar  have proposed an operational matrix in different ways for solving differential equations. In , the B-polynomials have been first orthonormalized by using Gram-schmidt orthonormalization process, and then the operational matrix of integration has been obtained. By the expansion of B-polynomials in terms of Taylor basis, Yousefi and Behroozifar have found the operational matrices of integration and product of B-polynomials. In this paper, firstly, we present operational matrices of integration Pb and product Ĉ for the B-polynomials, by the expansion of B-polynomials in terms of Legendre polynomials. Then, we use them for solving differential equationj=0sρj(x)y(j)(x)=g(x),0x1,

with the initial conditionsy(k)(0)=bk,0ks-1,

where g(x) and ρj(x), j=0,,s are given functions and y(x) is the unknown function to be determined. The main characteristic of this technique is that it reduces these equations to those of an easily soluble algebraic equation, thus greatly simplifying the equations. Special attention has been given to the applications of Legendre wavelets method , Homotopy perturbation method (HPM) , modified decomposition method (MDM) , Taylor matrix method , and Chebyshev wavelets method . The organization of this paper is as follows: in Section 2, we introduce the B-polynomials and their properties. Section 3 is devoted to the function approximation by using B-polynomials basis. Section 4 introduces the expansion of B-polynomial in terms of Legendre basis, and vice versa. The operational matrices of integration and product will be derived in Section 5. Section 6 is devoted to the solution method of differential equations. In section 7, we present some numerical examples. Numerical solution of each equation based on the exact and approximate solutions are compared. And Section 8 offers our conclusion.

2. B-Polynomials and Their Properties

The B-polynomials of mth degree are defined on the interval [0,1] as Bi,m(x)=(mi)xi(1-x)m-i,0im,

where(mi)=m!i!(m-i)!.

There are m+1,mth degree B-polynomials. For mathematical convenience, we usually set Bi,m(x)=0, if i<0 or i>m. These polynomials are quite easy to write down: the coefficients can be obtained from Pascal’s triangle. It can easily be shown that each of the B-polynomials is positive and also the sum of all the B-polynomials is unity for all real x[0,1], that is,i=0mBi,m(x)=1,x[0,1].

See  for complete details.

3. Function Approximation

B-polynomials defined above form a complete basis  over the interval [0,1]. It is easy to show that any given polynomial of degree m can be expressed in terms of linear combination of the basis functions. A function f(x) defined over [0,1] may be expanded asf(x)Pm(x)=i=0mciBi,m(x),m1.

Equation (3.1) can be written asPm(x)=CTϕ(x),

where C and ϕ(x) are (m+1)×1 vectors given byC=[c0,c1,,cm]T,ϕ(x)=[B0,m(x),B1,m(x),  ,  Bm,m(x)]T.

The use of an orthogonal basis on [0,1] allows us to directly obtain the least-squares coefficients of Pm(x) in that basis, and also ensures permanence of these coefficients with respect to the degree m of the approximant, that is, all the coefficients of Pm+1 agree with those of Pm(x), except for that of the newly introduced term. The B-polynomials are not orthogonal. But, these can be expressed in terms of some orthogonal polynomials, such as the Legendre polynomials. The Legendre polynomials constitute an orthogonal basis that is well suited [17, 18] to least-squares approximation.

4. Expansion of B-Polynomials in Terms of Legendre Basis and Vice Versa

To use the Legendre polynomials for our purposes, it is preferable to map this to [0,1]. A set of shifted Legendre polynomials, denoted by {Lk(x)} for k=0,1,, is orthogonal with respect to the weighting function w(x)=1 over the interval [0,1]. These polynomials satisfy the recurrence relation (k+1)Lk+1(x)=(2k+1)(2x-1)Lk(x)-kLk-1(x),k=1,2,,

withL0(x)=1,L1(x)=2x-1.

The orthogonality of these polynomials is expressed by the relation01Lj(x)Lk(x)dx={12k+1,j=k,0,jk,  j,k=0,1,2,.

When the approximant (3.1) is expressed in the Legendre formPm(x)=j=0mljLj(x),

by using (4.3), we can obtain the Legendre coefficients aslj=(2j+1)01Lj(x)f(x)dx,j=0,,m.

Lemma 4.1.

The Legendre polynomial Lk(x) can be expressed in the kth degree Bernstein basis B0,k(x),B1,  k(x),,Bk,k(x) as  Lk(x)=i=0k(-1)k+i(ki)Bi,k(x).

Now consider a polynomial Pm(x) of degree m, expressed in the mth degree Bernstein and Legendre bases on x[0,1]Pm(x)=j=0mcjBj,m(x)=k=0mlkLk(x).

We write the transformation of the Legendre polynomials on [0,1] into the mth degree Bernstein basis functions as Bk,  m(x)=i=0mwk,iLi(x),k=0,,m.

The elements wk,  i, k,i=0,1,,m, form an (m+1)×(m+1) basis conversion matrix W. To compute them, we multiply (4.8) by Lj(x), integrate over x[0,1], and use (4.3) to obtainwk,j=(2j+1)01Bk,m(x)Lj(x)dx.

We now replace (4.6) into (4.9) and obtainwk,  j=(2j+1)i=0j(-1)j+i(ji)01Bk,m(x)Bi,j(x)dx.

The integrals of the products of Bernstein basis functions can be found using01(1-x)rxidx=1(r+i+1)(r+ii),i,rN{0},

as follows:01Bk,m(x)Bi,j(x)dx=(mk)(ji)01xk+i(1-x)m+j-k-idx=(mk)(ji)(m+j+1)(m+jk+i).

Therefore, we have the elements of W aswk,j=(2j+1)m+j+1(mk)i=0j(-1)j+i(ji)(ji)(m+jk+i),k,j=0,,m.

Now, we write the transformation of the B-polynomials on [0,1] into mth degree Legendre basis functions as Lk(x)=j=0mΛk,jBj,m(x),k=0,,m.

The elements Λk,  j form an (m+1)×(m+1) basis conversion matrix Λ. Replacing (4.14) into (4.7) and rearranging the order of summation, we obtaincj=k=0mlkΛk,j,j=0,  ,m.

Since we can express each kth degree Bernstein basis function in the mth degree Bernstein basis as Bi,k(x)=j=im-k+i(ki)(m-kj-i)(mj)Bj,m(x),i=0,,k,

replacing (4.16) into (4.6) and rearranging the order of summation, we find that the basis transformation (4.14) is defined by the elementsΛk,j=1(mj)i=rmin{j,k}(-1)k+i(ki)(ki)(m-kj-i),r=max{0,j+k-m},

of the matrix Λ for k,j=0,,m. If we denote the Legendre basis vector asL(x)=[L0(x),L1(x),,Lm(x)]T,

using (3.4), (4.8), (4.14), and (4.18), we haveϕ(x)=WL(x),L(x)=Λϕ(x).

5. Operational Matrices of Integration and Product of B-Polynomials5.1. B-Polynomials Operational Matrix of Integration

Let Pb be an (m+1)×(m+1) operational matrix of integration, then0xϕ(t)dtPbϕ(x),0x1.

By using (4.19), we have0xϕ(t)dt=W0xŁ(t)dt=WPL(x),

where the (m+1)×(m+1) matrix P is the operational matrix of integration of the shifted Legendre polynomials on the interval [0,1] and can be obtained as P=12[1100000-1301300000-150150000000-12m-1012m-100000-12m+10],

and, therefore, by using (4.20)–(5.2), we have the operational matrix of integration asPb=WPΛ.

5.2. B-Polynomials Operational Matrix of Product

In this subsection, we present a general formula for finding the operational matrix of product of mth degree B-polynomials. Suppose that C is an arbitrary (m+1)×1 vector, then Ĉ is an (m+1)×(m+1) operational matrix of product wheneverCTϕ(x)ϕT(x)ϕT(x)Ĉ.

Using (4.19) and since CTϕ(x)=i=0mciBi,m, we haveCTϕ(x)ϕT(x)=(CTϕ(x))(LT(x)WT)=[L0(x)(CTϕ(x)),L1(x)(CTϕ(x)),,Lm(x)(CTϕ(x))]WT=[i=0mci(L0(x)Bi,m(x)),i=0mci(L1(x)Bi,m(x)),,i=0mci(Lm(x)Bi,m(x))]WT.

Now, we approximate all functions Lk(x)Bi,m(x) in terms of {Bi,m(x)}i=0m for i,k=0,1,,m. Letηk,i=[η0k,iη1k,iηmk,i],

by (3.2), we haveLk(x)Bi,m(x)ηk,iTϕ(x),i,k=0,1,,m.

Using (4.15), we can obtain the elements of vector ηk,i, for i,k=0,1,,m. Therefore,i=0mci(Lk(x)Bi,m(x))i=0mci(j=0mηjk,iBj,m(x))=j=0mBj,m(x)(i=0mciηjk,i)=ϕT(x)[i=0mciη0k,ii=0mciη1k,ii=0mciηmk,i]=ϕT(x)[ηk,0,ηk,1,,ηk,m]C=ϕT(x)C̃k,

whereC̃k=[ηk,0,ηk,1,,ηk,m]C,k=0,1,,m.

If we define a (m+1)×(m+1) matrix C̃=[C̃0,C̃1,,C̃m], then by using (5.6) and (5.9), we haveCTϕ(x)ϕT(x)ϕT(x)[C̃0,C̃1,,C̃m]WT=ϕT(x)C̃WT,

and, therefore, we have the operational matrix of product asĈ=C̃WT.

6. Solution of the Linear Differential Equation

Consider the linear differential equation (1.1) with the initial conditions (1.2). If we approximate g(x), ρj(x), j=0,,s and y(s)(x) as follows:g(x)=GTϕ(x),ρj(x)=PjTϕ(x),j=0,,s,y(s)(x)=CTϕ(x),

where G, Pj, j=0,,s, and C are the coefficients which are defined similarly to (3.3). With s-times integrating from (6.2) with respect to x between x=0 to x=x, using (5.1) and the initial conditions (1.2), we will havey(s-1)(x)=bs-1+CTPbϕ(x),y(s-2)(x)=bs-2+bs-1x+CTPb2ϕ(x),y(x)=b1+b2x+b32!x2++bs-1(s-2)!x(s-2)+CTPbs-1ϕ(x),y(x)=b0+b1x+b22!x2++bs-1(s-1)!x(s-1)+CTPbsϕ(x).

Letxi=diTϕ(x),i=1,2,,s-1,bs-i=bs-iETϕ(x),i=1,2,,s,

where1=ETϕ(x).

Substituting (6.4) into (6.3), we havey(s)(x)=CTϕ(x)=QsTϕ(x),y(s-1)(x)=(bs-1ET+CTPb)ϕ(x)=Qs-1Tϕ(x),y(s-2)(x)=(bs-2ET+bs-1d1T+CTPb2)ϕ(x)=Qs-2Tϕ(x),y(x)=(b1ET+b2d1T+b32!d2T++bs-1(s-2)!ds-2T+CTPbs-1)ϕ(x)=Q1Tϕ(x),y(x)=(b0ET+b1d1T+b22!d2T++bs-1(s-1)!ds-1T+CTPbs)ϕ(x)=Q0Tϕ(x).

Replacing (6.6) and (6.7) into (1.1), we obtainj=0sPjTϕ(x)ϕT(x)Qj=GTϕ(x).

Using (5.5), we havej=0sϕT(x)P̂jQj=ϕT(x)G.

Therefore, we getj=0sP̂jQj=G.

The unknown vector C can be obtained by solving (6.10). Once C is known, y(x) can be calculated from (6.7).

7. Illustrative ExamplesExample 7.1.

Consider the eighth-order linear differential equation given in  by y(viii)(x)-y(x)=-8ex,0x1,with the initial conditions y(0)=1,y(0)=0,y′′(0)=-1,y′′′(0)=-2,y(iv)(0)=-3,y(v)(0)=-4,y(vi)(0)=-5,y(vii)(0)=-6.The exact solution for this example is y(x)=(1-x)ex. Using the method described in Section 6, we assume that y(viii)(x) is approximated by y(viii)(x)=CTϕ(x). By using (5.1) and the initial conditions (7.2), we have y(x)=Q0ϕ(x), where Q0=ET-12!d2T-23!d3T-34!d4T-45!d5T-56!d6T-67!d7T+CTPb8=AT+CTPb8. We can express function -8ex as -8ex=GTϕ(x). Substituting (7.3)–(7.6) into (7.1), we obtain CTϕ(x)-(AT+DTPb8)ϕ(x)=GTϕ(x). Therefore, we get C=(I-(Pb8)T)-1(A+G), where I is the (m+1)×(m+1) identity matrix and Equation (7.8) is a set of algebraic equations which can be solved for C. Now, we apply the method presented in this paper with m=8 to solve (7.1) with the initial conditions (7.2). In Table 1, the numerical results obtained by the present method are compared with the results of the HPM  and MDM  and method in . As we see from this table, it is clear that the result obtained by the present method is very superior to that by HPM, MDM methods, and method in . The absolute difference between exact and approximate solutions is plotted in Figure 1. It is observed in this figure that the accuracy is of the order of 10-10.

Numerical results for Example 7.1.

 x Exact solution Method of  Method of  Method of  Presented method for N=8 for N=8 for  N=8 for  m=8 0 1 1 1 1 0.9999999992 0.1 0.9946538263 0.9946538263 0.9946538262 0.9946538266 0.9946538261 0.2 0.9771222065 0.9771222065 0.9771222014 0.9771222093 0.9771222065 0.3 0.9449011653 0.9449011653 0.9449010769 0.9449011752 0.9449011655 0.4 0.8950948186 0.8950948186 0.8950941522 0.8950948487 0.8950948184 0.5 0.8243606354 0.8243606356 0.8243574386 0.8243607328 0.8243606353 0.6 0.7288475202 0.728847522 0.7288359969 0.7288478604 0.7288475204 0.7 0.6041258122 0.6041258211 0.6040917111 0.6041269662 0.6041258121 0.8 0.4451081857 0.4451082201 0.4450208387 0.4451117669 0.4451081857 0.9 0.2459603111 0.2459604249 0.2457599482 0.2459703618 0.2459603113 1 0 3.326×10-7 -4.213×10-4 2.57×10-5 8×10-10

Absolute difference between exact and approximate solutions of Example 7.1.

Example 7.2.

Consider the Lane-Emden equation given in  by y′′(x)+2xy(x)=2(2x2+3)y(x),0x1, with the initial conditions y(0)=1,y(0)=0. The exact solution of this example is ex2. We solve (7.9) with the initial conditions (7.10) by using the method in Section 6 with m=11. The comparison among the present method, Legendre wavelets solution , and analytic solution for m=11 is shown in Table 2. As we see from this Table, it is clear that the result obtained by the present method is very superior to that by Legendre wavelets method. It is noted that the mean square error for this example, obtained in Legendre wavelets method, is 2.07×10-5; but in the present method, the mean square error is 2.3174×10-18. We display a plot of the approximate and exact solution of this example for m=11 in Figure 2.

Numerical results for Example 7.2.

 x Exact solution Method  of  Presented method for m=11 for  m=11 0.01 1.00010001 0.9958 1.00010001 0.3 1.09417428 1.0942 1.09417428 0.5 1.28402542 1.2843 1.28402542 0.75 1.75505466 1.7551 1.75505466 0.9 2.24790799 2.2480 2.24790799 0.95 2.46575981 2.4658 2.46575981 1 2.71828183 2.7184 2.71828183

Approximate and exact solution of Example 7.2 for m=11.

Example 7.3.

Consider the Bessel differential equation of order zero given in  by xy′′+y+xy=0, with the initial conditions y(0)=1,y(0)=0. The exact solution of this example is J0(x)=q=0(-1)q(q!)2(x2)2q. Now, we solve (7.11) with the initial conditions (7.12) by using the method in Section 6 with m=5. Table 3 shows the absolute difference between exact and approximate solutions of the present method and the methods in [11, 15] for equality basis functions. The results of  have been given in . As we see from this table, the maximum error for this example, for the methods in [11, 15], is 10-4; but in the present method, the maximum error is 10-7. We display a plot of the approximate and exact solution of this example for m=5 in Figure 3.

Numerical results for Example 7.3.

 x Method of  Method of  Presented method for M=3, k=2 for M=3, k=2 for m=5 0.0 9.36E-05 6.01E-05 4.1506E-07 0.1 2.78E-05 6.15E-05 1.6138E-07 0.2 3.60E-05 5.99E-05 7.5736E-08 0.3 1.83E-05 9.00E-06 1.2007E-07 0.4 4.12E-05 5.24E-05 3.8093E-08 0.5 2.695E-04 1.695E-04 1.3032E-07 0.6 9.22E-05 1.602E-04 2.8912E-08 0.7 8.26E-05 1.140E-04 1.2445E-07 0.8 6.88E-05 7.84E-05 6.8492E-08 0.9 1.026E-04 1.577E-04 1.6395E-07 1.0 2.689E-04 1.636E-04 4.1524E-07

Approximate and exact solution of Example 7.3 for m=5.

8. Conclusion

In this article, at first, we demonstrate the relation between the Bernstein and Legendre polynomials. By using this relation, we derived the operational matrix of integration and product of B-polynomials. They are applied to solve ordinary differential equations. The present method reduces an ordinary differential equations into a set of algebraic equations. We applied the presented method on three test problems and compared the results with their exact solutions and the other methods, revealing that the present method is very effective and convenient.

Acknowledgment

The work was supported by Alzahra university.

MandalB. N.BhattacharyaS.Numerical solution of some classes of integral equations using Bernstein polynomialsApplied Mathematics and Computation2007190217071716233976310.1016/j.amc.2007.02.058ZBL1122.65416ChakrabartiA.MarthaS. C.Approximate solutions of Fredholm integral equations of the second kindApplied Mathematics and Computation20092112459466252604410.1016/j.amc.2009.01.088ZBL1162.65416BhattacharyaS.MandalB. N.Use of Bernstein polynomials in numerical solutions of Volterra integral equationsApplied Mathematical Sciences2008236177317872443905ZBL1157.65513BhattiM. I.BrackenP.Solutions of differential equations in a Bernstein polynomial basisJournal of Computational and Applied Mathematics20072051272280232483910.1016/j.cam.2006.05.002ZBL1118.65087BhattaD. D.BhattiM. I.Numerical solution of KdV equation using modified Bernstein polynomialsApplied Mathematics and Computation2006174212551268222061210.1016/j.amc.2005.05.049ZBL1090.65117SinghA. K.SinghV. K.SinghO. P.The Bernstein operational matrix of integrationApplied Mathematical Sciences2009349242724362557992ZBL1185.41006YousefiS. A.BehroozifarM.Operational matrices of Bernstein polynomials and their applicationsInternational Journal of Systems Science2010416709716266274010.1080/00207720903154783ZBL1195.65061BhattacharyaS.MandalB. N.Numerical solution of a singular integro-differential equationApplied Mathematics and Computation20081951346350237922010.1016/j.amc.2007.04.103ZBL1130.65130YousefiS.Legendre wavelets method for solving differential equations of Lane-Emden typeApplied Mathematics and Computation2006181214171422227077210.1016/j.amc.2006.02.031ZBL1105.65080ZhengX.YangX.Techniques for solving integral and differential equations by Legendre waveletsInternational Journal of Systems Science200940111127113710.1080/002077209029747102573595RazzaghiM.YousefiS.Legendre wavelets direct method for variational problemsMathematics and Computers in Simulation2000533185192178494710.1016/S0378-4754(00)00170-1GolbabaiA.JavidiM.Application of homotopy perturbation method for solving eighth-order boundary value problemsApplied Mathematics and Computation20071912334346238553510.1016/j.amc.2007.02.091ZBL1193.65148MestrovicM.The modified decomposition method for eighth-order boundary value problemsApplied Mathematics and Computation2007188214371444233564010.1016/j.amc.2006.11.015ZBL1119.65069KurtN.SezerM.Polynomial solution of high-order linear Fredholm integro-differential equations with constant coefficientsJournal of the Franklin Institute2008345883985010.1016/j.jfranklin.2008.04.0162478511ZBL1202.65172BabolianE.FattahzadehF.Numerical solution of differential equations by using Chebyshev wavelet operational matrix of integrationApplied Mathematics and Computation20071881417426232736710.1016/j.amc.2006.10.008ZBL1117.65178FaroukiR. T.RajanV. T.Algorithms for polynomials in Bernstein formComputer Aided Geometric Design19885112694530210.1016/0167-8396(88)90016-7ZBL0648.65007DavisP. J.Interpolation and Approximation1975New York, NY, USADoverIsaacsonE.KellerH. B.Analysis of Numerical Methods1994New York, NY, USADoverDattaK. B.MohanB. M.Orthogonal Functions in Systems and Control1995River Edge, NJ, USAWorld ScientificLiY. M.ZhangX. Y.Basis conversion among Bezier, Tchebyshev and LegendreComputer Aided Geometric Design1998156637642162983410.1016/S0167-8396(98)00009-0ZBL0905.68145FaroukiR. T.Legendre-Bernstein basis transformationsJournal of Computational and Applied Mathematics20001191-2145160177421510.1016/S0377-0427(00)00376-9ZBL0962.65042HsiaoC. H.Hybrid function method for solving Fredholm and Volterra integral equations of the second kindJournal of Computational and Applied Mathematics200923015968253229110.1016/j.cam.2008.10.060ZBL1167.65473