Numerical solution of the second order linear and nonlinear integro-differential equations using Haar wavelet method

Abstract In this paper, a numerical algorithm is developed for the solution of second order linear and nonlinear integro-differential equations. The Haar collocation technique is applied to second order linear and nonlinear integro-differential equations. In Haar technique, the second order derivative in both linear and nonlinear integro-differential equation is approximated using Haar functions and the process of integration is used to obtain the expression of first order derivative and expression for the unknown function. Some linear and nonlinear examples are taken from literature for checking validation and convergence of proposed technique. The maximum absolute and root mean square errors are compared with the exact solution at different collocation and gauss points. The convergence rate using different numbers of collocation points is also calculated, which is approximately equal to 2.


Introduction
Integro-Differential Equations (IDEs) are equation that contains integral and derivative of an unknown function. There are several applications of IDEs in the field of engineering. Some applications of these equations can be found in heat and mass transfer (Kanwal, 1971), scattering in quantum physics and population models (Saaty, 1981). Several researchers worked on the solution of higher order IDEs. Chen, He, and Huang (2020) found the solution of second order linear Fredholm IDE by using the method of fast multi scale Galerkin with Dirichlet conditions. This method depends on matrix truncation strategy and leads to generating coefficient matrix rapidly. In Gegele, Evans, and Akoh (2014), Gegele et al. used Chebshyev series and power series technique to solve higher order linear Fredholm IDE through standard and Chebyshev Guass Labatto CPs. Hosseini and Shahmorad (2003) used Tau technique for the solution of Fredholm IDEs with arbitrary polynomial bases. In this method, the differential part in Fredholm IDEs is replaced by operational Tau representation. Rohaninasab, Maleknejad, and Ezzati (2018) established the Legendre collocation method for high order Volterra-Fredholm IDEs. The authors avoid the integration and represents mixed conditions as equivalent integral equations, by adding the neutral term to the equations. Saadatmandi and Dehghan (2010) formulated numerical solution of high order linear FID-difference equations with variable coefficients. In this method, Fredholm IDE reduces to a set of linear equations by broaden approximate solution in form of Legendre polynomial with unknown coefficients. In Yeganeh, Ordokhani, and Saadatmandi (2012), Yeganeh et al. presents sinc-collocation technique for solving second order boundary value problems of nonlinear IDEs. Manafianheris (2012) used the modified Laplace Adomian decomposition technique to solve the IDEs. Yassein (2019) developed the iterative technique for higher order IDEs. Kashkaria and Syam (2017) solve a class of nonlinear Volterra-Fredholm IDEs by utilizing stochastic computational intelligence technique. In Jimoh (2019), Jimoh used integrated Trapezoidal collocation technique for solving third order IDEs. In this technique, the approximation of highest derivative is done by the power series and canonical polynomials and the assumed solution is then integrated successively to obtain lower derivative in the problem. The trapezoidal rule is applied on the first order derivative to obtained the unknown function. These derivatives and unknown functions are substituted in the concerned problem and after simplification, the resulting equations is collocated at some equally spaced interior points of the interval which leads to a system of algebraic equations. Issa and Salehi (2017) developed Chebsyshev Galerkin technique for the numerical solution of perturbed Volterra-Fredholm IDEs. This technique obtain the approximate solution for IDEs by adding the perturbation terms to the right hand side of IDEs and then the resulting equation is solved by using Chebyshev-Galerkin technique. Rashidinia and Tahmasebi (2013) utilized the modified Taylor expansion method for the approximate solution of linear IDEs. In this method, Taylor expansion of the unknown function at an arbitrary point, the IDEs is solved into a system of linear equations for the unknown and its derivatives which can be dealt within easy way. This technique gives simple and closed form solution for a linear IDEs. Rani and Mishra (2019) presents modified Laplace Adomian decomposition method for Volterra integral and IDEs. A new modified laplace adomian decomposition method depends on Bernstein polynomials is presented to find the solution of nonlinear Volterra integral and IDEs. Khaireddine and Fateh (2016) used modified Haar wavelet functions for solution of first order linear IDEs.
In this paper, we used the HWC method for the solution of second order linear and nonlinear Volterra-Fredholm IDEs. Consider the following second order linear IDE and second order nonlinear IDE where a, b, c are functions of x, k 1 , k 2 are smooth functions known as kernels of integration, f(x) is given function, k 1 , k 2 , a and b are any constant real numbers. The paper is organized as: Haar functions are defined in Section 2. Numerical HWC technique for the solution of second order linear and nonlinear IDEs is given in Section 3. In Section 4, some problem from literature are given for validation of HWC method. Conclusion is given at the last Section 6.

Haar wavelet
The Haar functions are piecewise constant functions having three values 1, À1 and 0. The Haar scaling function on interval c 1 , c 2 ½ Þ is given by Aziz and Amin (2016) The mother wavelet on c 1 , c 2 ½ Þ is All the other terms in the Haar series can be represented in t 2 q 1 , q 2 ½ Þ except the scaling function where where integer d ¼ 2 r , where r ¼ 0, 1, :::, r 0 and let the integer f ¼ 0, 1, :::, d À 1: The number i can be obtain as i ¼ d þ f þ 1: In the interval 0, 1 ½ , q 1 , q 2 and q 3 are defined as: Any member of L 2 0, 1 ½ Þ, space of square integrable function is expressed as: This series is truncated at finite N terms for approximation purpose, i.e. v t ð Þ % X N k¼1 k k h k t ð Þ: We use the symbol and the value of the above integral is calculated by definition of h i and is given by Thus value of p i, 2 is by simplifying this integral, we have Also the value of p i, 3 is given by by simplifying this integral we obtain Similarly, the value of p i, 4 is given by Generally, Thus p i, n t ð Þ is obtained as under (Aziz & Amin, 2016), For HWC technique, the interval a, b ½ is discretized using formula: The Eq. (15) is known as collocation point (CP). Guass points (GPs) is also termed as integration points because numerical integration is carried out at these points. These points are represented as: , j ¼ 1, 2, 3, 4, :::, N À 1:

Haar collocation technique
In this section, numerical method is developed for the solution of second order linear and nonlinear IDEs. We developed Haar wavelet collocation (HWC) method for interval 0, 1 ½ : We use the notation H ¼ P N i¼1 : The second order derivative is approximated by Haar function and the expression for the lower order derivative is obtained by the process of integration. Also, the integrals involved in the Eqs. (1) and (2) is calculated by utilizing the Haar formula By applying the HWC method to Eqs. (1) and (2), we obtain a system of algebraic equations by substituting collocation and Guass points. Broyden's method is used for nonlinear system while linear system is solved by Gauss elimination technique to find the Haar coefficients. At the end, by using these coefficients, the numerical solution at the collocation points and Gauss points is obtained. Let Integrating from 0 to x two times and using IC (3), we have the following expression for first order and The expression (19) is known as the approximate solution of Eq. (1) and (2).

Linear case
Putting the Haar approximations and values of v 00 x ð Þ, v 0 x ð Þ and v(x) in Eq.
(1), we get By applying the above Haar integral formula (3), we have After simplification putting the collocation points, we get This is N Â N linear system, which is solved by any linear iterative method. Here we used Gauss elimination method for solution of this linear system. The unknown Haar coefficients are obtained from solution of this system. The solution at CPs is obtained by putting these Haar coefficients a i 's in Eq. (19).
Remark 3.1. If k 1 ¼ 0, then the Eq. (1) is known as second order linear Fredholm IDEs and if k 2 ¼ 0, then the Eq. (1) is called second order linear Volterra IDEs. Similar numerical method can be developed for the solution of Fredholm IDEs and Volterra IDEs.

Putting the Haar approximations and values of
(2), we get The above integrals are calculated by using Eq.
(3) and we have After simplification and putting CPs, we have This is N Â N nonlinear system of algebraic equations, Broyden's method is used for the solution of this nonlinear system. The unknown Haar coefficients are obtained from solution of this system. The required solution at CPs is obtained by substituting these unknown Haar coefficients a i 's in Eq. (19). The Jacobian of the system is calculated by using the following partial derivatives Remark 3.2. If k 1 ¼ 0, then the Eq.
(2) is known as second order nonlinear Fredholm IDEs and if k 2 ¼ 0, then the Eq. (2) is called second order nonlinear Volterra IDEs. Similar numerical method can be developed for the solution of Fredholm IDEs and Volterra IDEs.

Numerical examples
In this section, some examples are given to show the performance of the HWC method. If v apc denotes the approximate solution and v exc denotes the exact solution at CPs and GPs then maximum absolute error E cp and E gp are defined as The root mean square error at CPs and GPs is defined as The convergence rate at CPs and GPs is denoted by R cp and R gp is defined as (Majak, Shvartsman, Kirs, Pohlak, & Herranen, 2015): Problem 1. Consider the following linear second order Volterra IDE (Saray, 2019) v 00 x ð Þ À with the ICs v 0 0 Problem 2. Consider the second order Volterra IDE with the IC v 00 The exact solution is v x ð Þ ¼ cos hx: Problem 3. Consider the second order Fredholm IDE (Chen et al., 2020) v 00 x ð Þ À where The exact solution is v x ð Þ ¼ x x À 1 ð Þ: Problem 4. Consider the following second order linear Fredholm IDE (Avazzadeh, Heydari, & Loghmani, 2011) Problem 5. Consider the following second order Problem 6. Consider the second order nonlinear Problem 7. Let us consider the following nonlinear Problem 8. Consider the following second order non-

Results and discussions
The second order derivative in linear and nonlinear IDEs is approximated by Haar function and the expression for the first order derivative and unknown function is obtained by the process of integration. By applying the HWC technique we get a system of linear and nonlinear equations by substituting CPs. Broyden's method is used for nonlinear system, while Gauss elimination method is used for solution             of linear system to find the unknown Haar coefficients. Finally, by utilizing these Haar coefficients the solution at CPs and GPs is obtained. E cp , E gp , M cp and M gp errors for different number of CPs and GPs for all problems are given in tables. The maximum absolute and root mean square errors at different collocation and gauss points for Problem 1 are given in Table 1, for Problem 2 it is given in Table 2, for Problem 3 it is given in Table 3, for Problem 4 it is given in Table 4, for Problem 5 it is given in Table 5, for Problem 6 it is given in Table 6, for Problem 7 it is given in Table 7 and for Problem 8 it is given in Table 8. The comparison of both (numerical and analytical solution) for different CPs are shown in Figures. Figure 1 represents the comparison for 8 CPs of Problem 1, Figure 2 represents the comparison for 16 CPs of Problem 2, Figure 3 represents the comparison for 16 CPs of Problem 3, Figure 4 represents the comparison for 32 CPs of Problem 4, Figure 5 represents the comparison for 8 CPs of Problem 5, Figure 6 represents the comparison for 8 CPs of Problem 6, Figure 7 represents the comparison for 16 CPs of Problem 7, Figure 8, represents the comparison for 8 CPs of Problem 8. A good performance of the proposed HWC method is observed from tables. All errors are decreased by increasing the number of CPs and GPs. The R cp is also calculated, we see that the R cp is approximately equal to 2, which confirms the theocratical result of Majak et al. proved in Majak et al. (2015). An important property of HWC method, which is observed from all tables, is that if we take more CPs and GPs, the accuracy gets better.

Conclusion
In this paper, the HWC method is used to find the solution of linear and nonlinear second order IDEs. The E cp , E gp , M cp and M gp , errors are calculated for different number of CPs and GPs. The errors are given in tables each example. The convergence rate is also calculated which is approximately equal to two. Comparison of exact and approximate solution for 32 CPs are also shown for each example in figures. The main advantages of this method are its simplicity and less computation costs: it is due to the sparsity of the transform matrices and to the small number of significant wavelet coefficients. An important advantage of the HWC method, which can be observed from the figures and tables, is that whenever we increase the number of collocation points, the accuracy gets better. This is not the case in several methods where polynomial approximations are used. In those methods after a certain point the accuracy of the method starts deteriorating. MATLAB software is used for all computational work.

Disclosure statement
There does not exist any competing interest regarding this work.