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.