ISRN Applied Mathematics

Volume 2011 (2011), Article ID 787694, 15 pages

http://dx.doi.org/10.5402/2011/787694

## Approximate Solutions of Differential Equations by Using the Bernstein Polynomials

Department of Mathematics, Alzahra University, Tehran, Iran

Received 12 March 2011; Accepted 19 April 2011

Academic Editors: F. Ding and G. Psihoyios

Copyright © 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.

#### Abstract

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 [3], differential equations [4–7], and integro-differential equations [8]. Singh et al. [6] and Yousefi and Behroozifar [7] have proposed an operational matrix in different ways for solving differential equations. In [6], 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 and product for the B-polynomials, by the expansion of B-polynomials in terms of Legendre polynomials. Then, we use them for solving differential equation

with the initial conditions

where and , are given functions and 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 [9–11], Homotopy perturbation method (HPM) [12], modified decomposition method (MDM) [13], Taylor matrix method [14], and Chebyshev wavelets method [15]. 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 th degree are defined on the interval as [4]

where

There are ,th degree B-polynomials. For mathematical convenience, we usually set , if or . 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 , that is,

See [16] for complete details.

#### 3. Function Approximation

B-polynomials defined above form a complete basis [1] over the interval . It is easy to show that any given polynomial of degree can be expressed in terms of linear combination of the basis functions. A function defined over may be expanded as

Equation (3.1) can be written as

where and are vectors given by

The use of an orthogonal basis on allows us to directly obtain the least-squares coefficients of in that basis, and also ensures permanence of these coefficients with respect to the degree of the approximant, that is, all the coefficients of agree with those of , 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 . A set of shifted Legendre polynomials, denoted by for , is orthogonal with respect to the weighting function over the interval . These polynomials satisfy the recurrence relation [19]

with

The orthogonality of these polynomials is expressed by the relation

When the approximant (3.1) is expressed in the Legendre form

by using (4.3), we can obtain the Legendre coefficients as

Lemma 4.1. *The Legendre polynomial can be expressed in the kth degree Bernstein basis as [20]
*

Now consider a polynomial of degree , expressed in the th degree Bernstein and Legendre bases on

We write the transformation of the Legendre polynomials on into the th degree Bernstein basis functions as [21]

The elements , , form an basis conversion matrix . To compute them, we multiply (4.8) by , integrate over , and use (4.3) to obtain

We now replace (4.6) into (4.9) and obtain

The integrals of the products of Bernstein basis functions can be found using

as follows:

Therefore, we have the elements of as

Now, we write the transformation of the B-polynomials on into th degree Legendre basis functions as [21]

The elements form an basis conversion matrix . Replacing (4.14) into (4.7) and rearranging the order of summation, we obtain

Since we can express each th degree Bernstein basis function in the th degree Bernstein basis as [21]

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

of the matrix for . If we denote the Legendre basis vector as

using (3.4), (4.8), (4.14), and (4.18), we have

#### 5. Operational Matrices of Integration and Product of B-Polynomials

##### 5.1. B-Polynomials Operational Matrix of Integration

Let be an operational matrix of integration, then

By using (4.19), we have

where the matrix is the operational matrix of integration of the shifted Legendre polynomials on the interval and can be obtained as [22]

and, therefore, by using (4.20)–(5.2), we have the operational matrix of integration as

##### 5.2. B-Polynomials Operational Matrix of Product

In this subsection, we present a general formula for finding the operational matrix of product of th degree B-polynomials. Suppose that is an arbitrary vector, then is an operational matrix of product whenever

Using (4.19) and since , we have

Now, we approximate all functions in terms of for . Let

by (3.2), we have

Using (4.15), we can obtain the elements of vector , for . Therefore,

where

If we define a matrix , then by using (5.6) and (5.9), we have

and, therefore, we have the operational matrix of product as

#### 6. Solution of the Linear Differential Equation

Consider the linear differential equation (1.1) with the initial conditions (1.2). If we approximate , , and as follows:

where , , , and are the coefficients which are defined similarly to (3.3). With -times integrating from (6.2) with respect to between to , using (5.1) and the initial conditions (1.2), we will have

Let

where

Substituting (6.4) into (6.3), we have

Replacing (6.6) and (6.7) into (1.1), we obtain

Using (5.5), we have

Therefore, we get

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

#### 7. Illustrative Examples

*Example 7.1. *Consider the eighth-order linear differential equation given in [14] by
with the initial conditions
The exact solution for this example is . Using the method described in Section 6, we assume that is approximated by
By using (5.1) and the initial conditions (7.2), we have
where
We can express function as
Substituting (7.3)–(7.6) into (7.1), we obtain
Therefore, we get
where is the identity matrix and Equation (7.8) is a set of algebraic equations which can be solved for . Now, we apply the method presented in this paper with 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 [12] and MDM [13] and method in [14]. 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 [14]. 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 .

*Example 7.2. *Consider the Lane-Emden equation given in [10] by
with the initial conditions
The exact solution of this example is . We solve (7.9) with the initial conditions (7.10) by using the method in Section 6 with . The comparison among the present method, Legendre wavelets solution [10], and analytic solution for 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 ; but in the present method, the mean square error is . We display a plot of the approximate and exact solution of this example for in Figure 2.

*Example 7.3. *Consider the Bessel differential equation of order zero given in [15] by
with the initial conditions
The exact solution of this example is
Now, we solve (7.11) with the initial conditions (7.12) by using the method in Section 6 with . 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 [11] have been given in [15]. As we see from this table, the maximum error for this example, for the methods in [11, 15], is ; but in the present method, the maximum error is . We display a plot of the approximate and exact solution of this example for in Figure 3.

#### 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.

#### References

- B. N. Mandal and S. Bhattacharya, “Numerical solution of some classes of integral equations using Bernstein polynomials,”
*Applied Mathematics and Computation*, vol. 190, no. 2, pp. 1707–1716, 2007. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - A. Chakrabarti and S. C. Martha, “Approximate solutions of Fredholm integral equations of the second kind,”
*Applied Mathematics and Computation*, vol. 211, no. 2, pp. 459–466, 2009. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - S. Bhattacharya and B. N. Mandal, “Use of Bernstein polynomials in numerical solutions of Volterra integral equations,”
*Applied Mathematical Sciences*, vol. 2, no. 36, pp. 1773–1787, 2008. View at Google Scholar · View at Zentralblatt MATH - M. I. Bhatti and P. Bracken, “Solutions of differential equations in a Bernstein polynomial basis,”
*Journal of Computational and Applied Mathematics*, vol. 205, no. 1, pp. 272–280, 2007. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - D. D. Bhatta and M. I. Bhatti, “Numerical solution of KdV equation using modified Bernstein polynomials,”
*Applied Mathematics and Computation*, vol. 174, no. 2, pp. 1255–1268, 2006. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - A. K. Singh, V. K. Singh, and O. P. Singh, “The Bernstein operational matrix of integration,”
*Applied Mathematical Sciences*, vol. 3, no. 49, pp. 2427–2436, 2009. View at Google Scholar · View at Zentralblatt MATH - S. A. Yousefi and M. Behroozifar, “Operational matrices of Bernstein polynomials and their applications,”
*International Journal of Systems Science*, vol. 41, no. 6, pp. 709–716, 2010. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - S. Bhattacharya and B. N. Mandal, “Numerical solution of a singular integro-differential equation,”
*Applied Mathematics and Computation*, vol. 195, no. 1, pp. 346–350, 2008. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - S. Yousefi, “Legendre wavelets method for solving differential equations of Lane-Emden type,”
*Applied Mathematics and Computation*, vol. 181, no. 2, pp. 1417–1422, 2006. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - X. Zheng and X. Yang, “Techniques for solving integral and differential equations by Legendre wavelets,”
*International Journal of Systems Science*, vol. 40, no. 11, pp. 1127–1137, 2009. View at Publisher · View at Google Scholar - M. Razzaghi and S. Yousefi, “Legendre wavelets direct method for variational problems,”
*Mathematics and Computers in Simulation*, vol. 53, no. 3, pp. 185–192, 2000. View at Publisher · View at Google Scholar - A. Golbabai and M. Javidi, “Application of homotopy perturbation method for solving eighth-order boundary value problems,”
*Applied Mathematics and Computation*, vol. 191, no. 2, pp. 334–346, 2007. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - M. Mestrovic, “The modified decomposition method for eighth-order boundary value problems,”
*Applied Mathematics and Computation*, vol. 188, no. 2, pp. 1437–1444, 2007. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - N. Kurt and M. Sezer, “Polynomial solution of high-order linear Fredholm integro-differential equations with constant coefficients,”
*Journal of the Franklin Institute*, vol. 345, no. 8, pp. 839–850, 2008. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - E. Babolian and F. Fattahzadeh, “Numerical solution of differential equations by using Chebyshev wavelet operational matrix of integration,”
*Applied Mathematics and Computation*, vol. 188, no. 1, pp. 417–426, 2007. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - R. T. Farouki and V. T. Rajan, “Algorithms for polynomials in Bernstein form,”
*Computer Aided Geometric Design*, vol. 5, no. 1, pp. 1–26, 1988. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - P. J. Davis,
*Interpolation and Approximation*, Dover, New York, NY, USA, 1975. - E. Isaacson and H. B. Keller,
*Analysis of Numerical Methods*, Dover, New York, NY, USA, 1994. - K. B. Datta and B. M. Mohan,
*Orthogonal Functions in Systems and Control*, World Scientific, River Edge, NJ, USA, 1995. - Y. M. Li and X. Y. Zhang, “Basis conversion among Bezier, Tchebyshev and Legendre,”
*Computer Aided Geometric Design*, vol. 15, no. 6, pp. 637–642, 1998. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - R. T. Farouki, “Legendre-Bernstein basis transformations,”
*Journal of Computational and Applied Mathematics*, vol. 119, no. 1-2, pp. 145–160, 2000. View at Publisher · View at Google Scholar · View at Zentralblatt MATH - C. H. Hsiao, “Hybrid function method for solving Fredholm and Volterra integral equations of the second kind,”
*Journal of Computational and Applied Mathematics*, vol. 230, no. 1, pp. 59–68, 2009. View at Publisher · View at Google Scholar · View at Zentralblatt MATH