#### Abstract

A new collocation method is developed for solving BVPs which arise from the problems in calculus of variation. These BVPs result from the Euler-Lagrange equations, which are the necessary conditions of the extremums of problems in calculus of variation. The proposed method is based upon the Bernoulli polynomials approximation together with their operational matrix of differentiation. After imposing the collocation nodes to the main BVPs, we reduce the variational problems to the solution of algebraic equations. It should be noted that the robustness of operational matrices of differentiation with respect to the integration ones is shown through illustrative examples. Complete comparisons with other methods and superior results confirm the validity and applicability of the presented method.

#### 1. Introduction

In a large number of applied sciences problems such as analysis, mechanics, and geometry, it is necessary to determine the maximal and minimal of a certain function. Because of the important role of this subject in sciences and engineering, considerable attention has been provided on this kind of problems. Such problems are called variational problems. The various applications of variational problems such as industrial and biological are introduced in [1]. Since a huge size of such equations cannot be solved explicitly, it is often necessary to resort to the approximation and numerical techniques.

In the recent years, the studies on variational problems were developed very rapidly and intensively. For instance, one can point out to the methods that based upon operational matrices of integration of a huge size of polynomials and functions. In the last four decades, numerical methods which are based on the operational matrices of integration (especially for orthogonal polynomials and functions) have received considerable attention for dealing with variational problems. The key idea of these methods is based on the integral expression where is an arbitrary basis vector and is the constant matrix called the operational matrix of integration. The matrix has already been determined for many types of orthogonal (or nonorthogonal) bases such as the Walsh functions [2], the Laguerre polynomials [3], the Chebyshev polynomials [4], the Legendre polynomials [5], and the Fourier series [6]. However, methods that are based on the high-order Gauss quadrature rules [7, 8] could be applied for variational problems, but the need to more CPU times and ill-conditioning of the associated algebraic systems are some disadvantages of these approaches.

On the other hand, since the beginning of 1994, the Laguerre, Chebyshev, Taylor, Legendre, Hermite, Fourier, and Bessel (matrix and collocation) methods have been used in the works [9–16] to solve the high-order linear and the nonlinear differential (including hyperbolic partial differential equations) Fredholm-Volterra integrodifferential difference delay equations and their systems. Also, the Bernoulli matrix method has been used to find the approximate solutions of differential and integrodifferential equations [17–20]. The main characteristic of these approaches is based on the operational matrices of differentiation instead of integration. The best advantage of these techniques with respect to the integration methods is that, in the fundamental matrix relations, there is not any approximation symbol; meanwhile, in the integration forms such as (1), the approximation symbol could be seen obviously. In other words, where is the operational matrix of differentiation for any selected basis such as the above-mentioned polynomials, functions, and truncated series. The readers can see that there is no approximation symbol in (2); meanwhile, this can be seen in (1) by using operational matrices of integration. For justifying this expression, one can refer to this subject that after differentiating an th degree polynomial, we usually reach to a polynomial which has less than th degree. However, in the integration processes, the degree of polynomials would be increased.

In this paper, in the light of the above-mentioned methods and by means of the matrix relations between the Bernoulli polynomials and their derivatives, we develop a new method called the Bernoulli collocation method (BCM) for finding the extremum of the functional To find the extreme value of , the boundary points of the admissible curves are known in the following form: The necessary condition to extremize is that it should satisfy the Euler-Lagrange equations with boundary conditions given in (4). The system of boundary value problems (5) does not always have a solution, and if the solution exists, it may not be unique. Note that in many variational problems, the existence of a solution is obvious from the physical or geometrical meaning of the problem, and if the solution of the Euler equation satisfies the boundary conditions, it is unique. Also, this unique extremal will be the solution of the given variational problem. Thus, another approach for solving the variational problem (3) is finding the solution of the system of ordinary differential equations (5) which satisfies the boundary conditions (4) which were called systems of boundary value problems (BVPs). The simplest form of the variational problem (3) is with the given boundary conditions Here, the necessary condition for the extremum of the functional (6) is to satisfy the following second-order differential equation: with boundary conditions given in (7).

We again emphasize that our aim is to solve BVPs such as (5) and (8) by using our method which has superior results with respect to several methods in the literature. It should be noted that the handeling of BVPs needs more accuracy with respect to the initial value problems (IVPs). For instance, see [21–23] and the references therein. To the best of our knowledge, this is the first work concerning the Bernoulli collocation method for solving nonlinear BVPs. This partially motivated our interest in such method.

The rest of this paper is organized as follows. In Section 2, we review several properties of the Bernoulli polynomials. Section 3 is devoted to the basic idea of this paper (i.e., the Bernoulli collocation method). Error analysis and accuracy of the approximate solution is given in Section 4. Several illustrative examples are provided in Section 5 for confirming the effectiveness of the presented method. Section 6 contains some conclusions and notations about the future works.

#### 2. The Bernoulli Polynomials and Their Operational Matrix

The Bernoulli polynomials play an important role in different areas of mathematics, including number theory and the theory of finite differences. The classical Bernoulli polynomials are usually defined by means of the exponential generating functions (see [18]): The following familiar expansion (see [17]): is the most primary property of the Bernoulli polynomials. The first few Bernoulli polynomials are The Bernoulli polynomials satisfy the well-known relations (see [18]): If we introduce the Bernoulli vector in the form , then the derivative of the , with the aid of the first property of (12), can be expressed in the matrix form by where is the operational matrix of differentiation.

Accordingly, the th derivative of can be given by where is defined in (13).

#### 3. Basic Idea

Now, we consider the general form of the variational problem (3). Finding the solution of the problem (3) needs to solve the corresponding BVP (5) with boundary conditions (4). We assume that is the exact solution of the BVP (5). Our aim is to approximate over the interval by the following linear combinations of the Bernoulli polynomials: where , in which for and are the unknown coefficients and are the Bernoulli polynomials which are defined in the previous section. For convenience, consider the second-order BVP (5) as follows: By using (14), for and , we have We consider the matrix vector forms of , , and for which have been shown in (15) and (17) and then replace in (16) as follows: Because of stability properties of the Gaussian points [7], we collocate the above BVP at the nodes for as the roots of the th degree shifted Legendre polynomial as follows: where . Note that according to the properties of Gaussian points we have for all values of . The above system consists of equations with unknowns. Now, consider the equations from boundary conditions as follows The above equations together with (19) form a nonlinear algebraic system with equations and unknowns for and . After solving this algebraic system, we obtain the approximated solutions of (3).

#### 4. Error Analysis and Accuracy of the Solution

This section is devoted to provide an error bound for the approximated solution which was presented in the previous section. Before presenting the main theorem of this section, we need to recall some useful corollaries and theorems. Then, we transform the basic equation (8) (or (5)) together with the boundary conditions (7) (or (4)) to a nonlinear Fredholm-Volterra integral equation (or system of nonlinear Fredholm-Volterra integral equations). Therefore, the main theorem could be stated which guarantees the convergence of the truncated Bernoulli series to the exact solution under several mild conditions.

Now, suppose that and is the set of the Bernoulli polynomials and and is an arbitrary element in . Since is a finite dimensional vector space, has the unique best approximation belongs to such as , that is, Since , there exist the unique coefficients such that

Corollary 1. *Assume that is an arbitrary function and also is approximated by the truncated Bernoulli serie , then the coefficients for all can be calculated from the following relation:
*

*Proof. *(See [18]).

Corollary 2. *Assume that one approximates the function on the interval by the Bernoulli polynomials as discussed in Corollary 1. Then, the coefficients decay as follows:
**
where denotes the maximum of in the interval .*

*Proof. *Since it is trivial, we omit the proof.

The above corollary implies that the Bernoulli coefficients are decayed rapidly as the increasing of .

Consider Corollary 1 again. We will provide the error of the associated approximation.

Theorem 3 (see [17]). *Suppose that is an enough smooth function in the interval and is approximated by the Bernoulli polynomials as done in Corollary 1. With more details, assume that is the approximate polynomial of in terms of the Bernoulli polynomials and is the remainder term. Then, the associated formulas are stated as follows:
**
where and denotes the largest integer not greater than . *

*Proof. *See [17].

Trivially, the algebraic degree of exactness of the operator is .

Theorem 4. *Suppose that and is the approximate polynomial using the Bernoulli polynomials. Then, the error bound would be obtained as follows:
**
where and denote the maximum value of and in the interval , respectively.*

*Proof. *By considering , the proof is clear.

Corollary 5. *Assume that is an arbitrary function and also is approximated by the two variable truncated Bernoulli series , then the coefficients for all can be calculated from the following relation:
*

*Proof. *See [18].

Theorem 6. *Suppose that is a smooth enough function and is the approximate polynomial using the Bernoulli method. Then, the error bound would be obtained as follows:
**
where and denote the maximum value of and in the interval , respectively.*

*Proof. *See [20].

For the clarity of presentation, we only consider the equation (8) in the following simple form where is a continuously differentiable function with respect to its arguments. Our aim is to transform the above BVP into a nonlinear Fredholm-Volterra equation. Therefore, we assume that . By integrating both sides of the mentioned relation in the interval , we have Again, one can integrate the above integral equation in the interval as follows: Taking in (32) yields According to (31) and (32) we should have Therefore, the nonlinear BVP (30) transformed into the following nonlinear Fredholm-Volterra integral equation: where , , and are continuously differentiable functions with respect to their arguments.

Theorem 7. *Assume that (35) has a uniqe solution . Also, suppose that the kernels and are approximated by the Bernoulli truncated series as shown in Corollary 5, and, hence, by these approximations the equation (35) has the numerical solution (in terms of the Bernoulli polynomials). Then, provided by the conditions , , and .*

*Proof. *According to the assumption, we should have
Subtracting (36) from (35) yields
Since is a continuously differentiable function, it is jointly Lipschitz with respect to its second and third arguments, in other words,
where , , , and . By factorizing the coefficients of , we have
More precisely,
Since and are enough differentiable, we can use Theorem 6, and hence . On the other hand, because of , one can deduce that , and this completes the proof.

#### 5. Numerical Examples

In this section, several numerical examples are given to illustrate the accuracy and effectiveness of the proposed method, and all of them are performed on a computer using programs written in MAPLE 13. In this regard, we have reported in tables and figures the values of the exact solution , the polynomial approximate solution , and the absolute error function at any selected points of the given interval . It should be noted that, in the second example, we provide an interesting example in which our results are superior with respect to an integral operational matrix method which was based on the Legendre polynomials [5]. Moreover, our method obtains more accurate results with regard to the differentiation of operational matrix which were based on Laguerre, Hermite, and Bessel polynomials and series [3, 14, 15].

*Example 8 (see [3]). *As the first example, we consider the following variational problem with the exact solution
subject to the boundary conditions
According to (8), the associated Euler Lagrange equation is as follows:
We solve this problem by considering notations in the Section 3 by taking , and 13. In the first figure (i.e., Figure 1), we compare our absolute errors with the Laguerre method [3] (LM) by taking and 10. Also, in the second figure (i.e., Figure 2), we compare our absolute errors with the Hermite method [14] (HM) by taking and 13. We should recall that the Laguerre method [3] is a matrix method which has less accuracy with respect to any global polynomial collocation method. This fact is obvious from Figure 1. Moreover, the Hermite method [14] is a collocation method which has low stability property with regard to our method. The interested author can refer to the reference [18] and see the associated ill-conditioned matrix related to the Hermite method.

*Example 9 (see [5]). *As the second example, we consider the following interesting variational problem with the exact solution
subject to the boundary conditions
According to (8), the associated Euler Lagrange equation is as follows:
Again, by using the basic idea of this paper, we solve this problem by taking and 7. In the third figure (i.e., Figure 3), we compare our absolute errors with the Legendre method [5] (LGM) by taking and 7. From this figure, one can see the robustness of collocation methods (for instance, the proposed method) with regard to integral operational matrices methods. One of the disadvantages of matrix methods is approximating the known functions by the selected bases (e.g., Legendre), and this may affect the numerical solution seriously and surely the errors increased. However, collocation methods do not approximate the known functions in the basic problem, and the corresponding errors do not increase, and by using a suitable choice of collocation (interpolation) nodes, we can reach to a stable numerical solution.

*Example 10 (see [5]). *In this example, we consider the following variational problem with the exact solution :
subject to the boundary conditions
In this case, the Euler-Lagrange equation is written in the following form:
The above BVP seems to be more hard with respect to the other examples of this section. We also solve this BVP by our method and reach to high accurate results with regard to other collocation methods such as the Bessel collocation method [15] and the Taylor collocation method [11]. The absolute error comparisons with the Bessel method (BM) have been depicted in Figure 4, and the absolute error comparisons with the Laguerre method (LM) and Taylor method (TM) have been illustrated in Figure 5. Again, we can see that our results are superior even in comparison with collocation methods.

#### 6. Conclusions

This paper described an efficient method for finding the extremum of a function over the specified domain. The main goal is to find the solution of an ordinary differential equation (in the BVP form) which arises from the variational problem. Our approach was based on the Bernoulli polynomials and their operational matrix of differentiation together with a set of suitable collocation nodes. The approximation of the solution together with imposing the collocation nodes is utilized to reduce the computation of this problem to some algebraic equations. The method is computationally attractive, and applications are demonstrated through illustrative examples. The obtained results showed that this approach can solve the problem effectively. Moreover, the proposed method could be applied for fractional variational problems [24] with some modifications.

#### Conflict of Interests

The authors declare that they do not have any conflict of interests in their submitted paper.

#### Acknowledgment

The authors want to thank the editor and reviewers for their interesting discussions and for their valuable comments which led to an improved version of the paper.