Research Article | | Peer-Reviewed

An Effective Matrix Technique for the Numerical Solution of Second Order Differential Equations

Received: 9 July 2024     Accepted: 29 July 2024     Published: 15 August 2024
Views:       Downloads:
Abstract

In this paper, an effective technique for solving differential equations with initial conditions is presented. The method is based on the use of the Legendre matrix of derivatives defined on the close interval [-1,1]. Properties of the polynomial are outlined and further used to obtain the matrix of derivative which was used in transforming the differential equation into systems of linear and nonlinear algebraic equations. The systems of these algebraic equations were then solved using Gaussian elimination method to determine the unknown parameters required for approximating the solution of the differential equation. The advantage of this technique over other methods is that, it has less computational manipulations and complexities and also its availability for application on both linear and nonlinear second-order initial value problems is impressive. Other advantage of the algorithm is that high accurate approximate solutions are achieved by using a greater number of terms of the Legendre polynomial and once the operational matrix is obtained, it can be used to solve differential equations of higher order by introducing just a little manipulation on the operational matrix. Some existing sample problems from literature were solved and the results were compared to show the validity, simplicity and applicability of the proposed method. The results obtained validate the simplicity and applicability of the method and it also reveals that the method perform better than most existing methods.

Published in Applied and Computational Mathematics (Volume 13, Issue 4)
DOI 10.11648/j.acm.20241304.15
Page(s) 111-117
Creative Commons

This is an Open Access article, distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution and reproduction in any medium or format, provided the original work is properly cited.

Copyright

Copyright © The Author(s), 2024. Published by Science Publishing Group

Keywords

Legendre Polynomials, Matrix Calculus, Differential Equations

1. Introduction
The primary use of differential equations in general is to model motion, which is commonly called growth in economics. Specifically, a differential equation expresses the rate of change of the current state as a function of the current state.
In economics, differential calculus is used to compute marginal cost, marginal revenue, maxima and minima elasticity, partial elasticity and also enabling economists to predict maximum profit (or) minimum loss in a specific condition; one can also think of a change in general price level with respect to time as inflation. Second-order derivative with respect to time shows the rate of change of inflation, how inflation changes over time. Similarly, differentiating capital with respect to time shows investment.
Most ordinary differential equations arising in real-life applications cannot be solved exactly. These ordinary differential equations can be analyzed qualitatively. However, qualitative analysis may not be able to give accurate answers. A numerical method can be used to get an accurate approximate solution to a differential equation.
Motivated by these advantages, we will use Legendre operational matrix of derivatives through collocation method to approximate the solution of general second order differential equations with initial conditions.
The general second order differential equation is given as follows:
d2ydx2=axdydx+bxy+fx(1)
where ax,bxand fx are functions of x. Conventionally, (1) can be solved using different methods such as the method of (educated) guess, the method of variation of parameters and it can also be solved by reducing it to a system of first order differential equations, and then any method of solving first order differential equations can then be applied to solve it. The setbacks of this technique were reported in (). The method of collocation and interpolation of the power series and other polynomial basis functions were used to generate approximate solution and these techniques were reported by many scholars among them are () to mention a few. Their approaches and techniques generated implicit continuous linear multistep methods which require separate predictors for implementation; this method is called the predictor-corrector method. There are major setbacks of these methods, numerical techniques such the block linear multistep methods lately introduced by researchers such as () have shown allot of advantages over the predictor-corrector method. However, the advantages are compensated by tedious computational work and the use of more advance software to enable it handle the work.
In this paper, a collocation technique based on the Legendre operational matrix of derivatives for second order differential equations is proposed. The advantages of this technique over other methods is that it has less computational manipulations and complexities because it only involves operational matrix of derivatives and its transpose and thus, reduces the time involve in the derivation of the schemes, analysis and implementation as is in the case with linear multistep methods.
1.1. Legendre Polynomials
The Legendre polynomials exhibit simple and convenient form for calculation, compared with other orthogonal polynomials (Chebyshev polynomials, shifted Legendre polynomials...). They are well known family of orthogonal polynomials on the interval -1,1. They are solutions to the popular Legendre differential equation given as follows;
1-x2d2ydx2- 2xdydx+ nn+1y=0(2)
They are widely used because of their smooth properties in the approximation of functions . Equation (2) can be solved by series solution method (See ). The first few Legendre polynomials using the Rodriquez formula are:
l0x=1, l1x=x, l2x=123x2-1, l3x=125x3-3x, l4x=1835x4-30x2+3 l5x=1863x5-70x3+15x,l6x=116231x6-315x4+105x2-5,...
The recurrence relation for Legendre polynomial is given by
l0x=1, l1x=x
lk+1x=2k+1k+1xlkx-kk+1lk-1x, k=1, 2, 3, 
The Rodrigues formula for the Legendre polynomial is
lkx=12kk!×dkdxkx2-1k,k=,0,1,2,...
Properties of Legendre polynomials
The following properties hold for Legendre polynomials are
lk-x=-1nlkx
i. lk1=1
ii. lk-1=-1n
iii. lk0=0, k odd
iv. l'k0=0, k even
Thus, the condition for orthogonality is:
01lkxlixdx=12k+1, if k=i0, if ki
This implies that any function yx[-1, 1] can be approximated by Legendre polynomials as follows:
yxk=0cklkx(3)
where
ck=<yx, lkx>=2k+101yx, lkxdx
1.2. Preliminaries
We introduce the Legendre vector Lx in the form Lx=l0x, l1x, , lnx, then the derivative of the vector Lx, can be expressed in matrix form by
Lx'T=MLxT=LxMT(4)
WhereLx'T=l0'xl1'xl2'x...l'x, M=0101..00030..60005..00000..0 0000..2n-1 0000..0andLxT=l0xl1xl2x...lnx
Where the matrix M is an N+1×N+1 matrix calculus, similarly, the kth derivative of Lx can be obtained from the following relation;
Lx'T=MLxTLx1=LxMTLx2T=Lx1MT=LxMTMT=LxMT2Lx3T=Lx2MT=LxMT2MT=LxMT3...LxkT=LxMTk(5)
In this paper, we shall use the collocation method based on Legendre matrix calculus to solve numerically the general second order differential equation.
2. Derivation of the Method
We now derive the algorithm for solving (1.1), that is
y''=fx, y, y'
Let us suppose the solution of (1) is to be approximated by the first N+1 terms of the Legendre polynomial; thus, we can write (3) as
yNxj=0Ncjxljx=LxCT (6)
where the Legendre coefficients C vector and the Legendre vector Lx are given by
C=[c0, c1,c2,,cN]Lx=[l0x,l1x,l2x,,lNx](7)
The second derivative of (6) can be expressed as follows
yN2x=j=0Ncjxlj2x=L2xCT=LxMT2CT (8)
where M is the matrix calculus defined in (4) above. Now substituting (6) and (8) into (1), we have
LxMT2CT=axLxMT1CT+bxLxCT+fx(9)
Finally, to find the approximate solution, we collocate the transformed equation (9) at different collocation points xj=jN-khj, j=0,1,2,,N-k, to obtain N-2 nonlinear algebraic equations using
LxjMT2CT=axjLxjMT1CT+bxjLxjCT+fxj, j=0,1,.,N-2(10)
These equations together with the initial conditions give N+1×(N+1) nonlinear systems of algebraic equations which can be solved using Newton’s iterative method for the unknown constants. Finally, yNx given in (6) can be calculated.
3. Numerical Illustrations
The following numerical experiments are performed with the aid of MAPLE 18 and Scientific Workplace software packages in order to further affirm the applicability, simplicity and accuracy of the proposed method.
Example 1
Let us first consider the second order pantograph equation solved by given by
y''x=34yx+yx2-x2+2, x0, 1, h=0.01
Subject to the initial conditions y0=y'0=0, the exact solution to this problem is known to be yx=x2.
Applying our technique with N=3, we have the following expression;
LxMT2CT=34LxCT+Lx2CT-x2+2 (ϑ1)
Using the initial conditions, we have respectively,
L0CT=0, L0MT1CT=0 (ϑ2)
Collocating (ϑ1) at x=0, 12 and evaluating (ϑ2) at x=0, we have the following algebraic systems of equations
3c=74c-78c+23c+340c=74c+1160c-6999780000c-23999325600000c+7999940000c-32c=0 c-12c=0
Solving for the unknown coefficients [c0, c1,c2,c3], we have
[c=13,c=0,c=23,c=0]
Substituting these approximate values into (6), we get the approximate solution to the problem as
yNx=x2
The approximate solution is the same as the exact solution showing the accuracy of the method.
Example 2
Consider the second order differential equation solved by given by
y''x=yx+xe3x, x0, 1, h=0.0025
Subject to the initial conditions y0=-332, y'0=-532, the exact solution to this problem is known to be yx=4x-332e-3x.
Applying our technique with N=5, we have the following expression:
LxMT2CT=LxCT+xe3x (ϑ1)
Using the initial conditions, we have respectively,
L0CT=-332, L0MT1CT=-532 (ϑ2)
Collocating (ϑ1) at x=0, 13, 23,  12 and evaluating (ϑ2) at x=0, we have the following Values of the unknown coefficients
[c=-6. 015660797 02×10⁻²,c=2. 794908665 50×10⁻²,c=0.109373977 228,
c=0.159771274 744,c=5. 624959089 12×10⁻²,c=2. 957750691 22×10⁻²]
Substituting these approximate values into (6), we get the approximate solution to the problem as
0.232922866 934x+0.246091960 149x+0.140625001 378x³-0.046875x²-0.156250000 001x-0.09375
Table 1. Showing the numerical comparison of example 2 for N=5.

x

Exact

Approximate solution by LOM

Absolute error by LOM

Absolute error by

5]

0.0025

-0.094140915761800

-0.0941409157619

2.5000×10⁻¹⁵

7.020×10-14

0.0050

-0.094532404142338

-0.09 45324041423

5.6388×10⁻¹⁵

1.217×10-13

0.0075

-0.094924451608388

-0.0949244516084

1.9695×10⁻¹⁴

3.396×10-12

0.0100

-0.095317044390700

-0.0953170443908

9.6425×10⁻¹⁴

8.122×10-12

0.0125

-0.095710168480980

-0.0957101684814

3.8902×10⁻¹³

1.453×10-11

0.0150

-0.096103809629100

-0.0961038096304

1.2407×10⁻¹²

2.233×10-11

0.0175

-0.096497953340300

-0.0964979533436

3.3021×10⁻¹²

3.156×10-11

0.0200

-0.096892584872264

-0.0968925848799

7.6781×10⁻¹²

4.220×10-11

0.0225

-0.097289689232184

-0.0972876892483

1.6104×10⁻¹¹

5.421×10-11

0.0250

-0.097683251173919

-0.0976832512051

3.1149×10⁻¹¹

6.754×10-11

xample 3
Consider the following nonlinear second order boundary value problem solved in given as:
y''x=y'x2-yx-16x6+2, x-1, 1, h=0.0025
subject to the initial conditions y-1.0=0, y'1.0=-2, the exact solution to this problem is known to be yx=x2-x4.
Applying our technique with N=4 we have the following expression;
LxMT2CT=LxMT1CT2-LxCT-16x6+2 (ϑ3)
Using the initial conditions, we have respectively,
L0CT=0, L0MT1CT=0 (ϑ4)
Collocating (ϑ3) at x=0, 12, 14 and evaluating (ϑ4) at x=0, we have the following Values of the unknown coefficients
[c=0.133333333 333,c=0.0,c=9. 523809523 81×10⁻²,c=0.0,c=-0.228571428 571]
Substituting these approximate values into (6), we get the approximate solution to the problem as
-1. 000000000 00x+1. 000000000 00x²-1. 750000000 00×10⁻¹³
Table 2. Showing the numerical comparison of example 3 for N=4.

x

Exact

Approximate solution by LOM

Absolute error LOM yNx-yx

0.0025

6.24996093750×10⁻⁶

6.24996076250×10⁻⁶

1. 75×10⁻¹³

0.0050

2.4999 3750000×10⁻⁵

2.49993748250×10⁻⁵

1. 75×10⁻¹³

0.0075

5.6246 8359375×10⁻⁵

5.62468357625×10⁻⁵

1. 75×10⁻¹³

0.0100

9.999000000000×10⁻⁵

9.99899998250×10⁻⁵

1. 75×10⁻¹³

0.0125

1.562255859375×10⁻⁴

1.56225585763×10⁻⁴

1. 75×10⁻¹³

0.0150

2.249493750000×10⁻⁴

2.24949374825×10⁻⁴

1. 75×10⁻¹³

0.0175

3.061562109375×10⁻⁴

3.06156210763×10⁻⁴

1. 75×10⁻¹³

0.0200

3.998400000000×10⁻⁴

3.99839999825×10⁻⁴

1. 75×10⁻¹³

0.0225

5.059937109375×10⁻⁴

5.05993710763×10⁻⁴

1. 75×10⁻¹³

0.0250

6.24609375000×10⁻⁴

6.24609374825×10⁻⁴

1. 75×10⁻¹³

Example 4
Consider the second order differential equation solved by given by
y''x=xy'x2, x-1, 1, h=0.0025
Subject to the initial conditions y0=1, y'0=12, the exact solution to this problem is known to be yx=1+12ln2+x2-x.
Applying our technique with N=4, we have the following expression;
LxMT2CT=xLxMT1CT2 (ϑ5)
Using the initial conditions, we have respectively,
L0CT=1, L0MT1CT=12 (ϑ6)
Collocating (ϑ5) at x=0, 12, 14 and evaluating (ϑ6) at x=0, we have the following values of the unknown coefficients
[c=1. 000003906 25,c=0.524999990 234,c=1. 116072282 34×10⁻⁵,
c=1. 666666015 62×10⁻²,c=4. 464289129 35×10⁻⁶]
Substituting these approximate values into (6), we get the approximate solution to the problem as
1. 953126494 09×10⁻⁵x+4. 166665039 05×10⁻²x³+3. 75×10⁻¹⁷x²+0.500000000 000x+1. 000000000 00
Table 3. Numerical comparison of example 4 for N=4.

x

Exact

Approximate solution by LOM

Absolute error LOM yNx-yx

Absolute error by

5] yNx-yx

0.0025

1. 001250000 65

1.001250000 60

1.017×10⁻¹⁶

1.339×10⁻¹⁴

0.0050

1. 002500005 21

1.002500004 82

9.359×10⁻¹⁵

7.321×10⁻¹⁴

0.0075

1. 003750017 58

1.003750016 29

9.339×10⁻¹⁴

1.000×10⁻¹³

0.0100

1. 005000041 67

1.005000038 63

4.460×10⁻¹³

1.250×10⁻¹²

0.0125

1. 006250081 38

1.006250075 49

1.462×10⁻¹²

1.372×10⁻¹²

0.0150

1. 007500140 63

1.007500130 52

3.812×10⁻¹²

4.824×10⁻¹²

0.0175

1. 008750223 32

1.008750207 37

8.514×10⁻¹²

6.314×10⁻¹²

0.0200

1. 010000333 35

1.010000309 73

1.701×10⁻¹¹

2.801×10⁻¹²

0.0225

1. 011250474 65

1.011250441 25

3.122×10⁻¹¹

4.322×10⁻¹²

0.0250

1. 012500651 10

1.012500605 63

5.367×10⁻¹¹

6.757×10⁻¹¹

4. Conclusion
In this work, a collocation technique based on the Legendre matrix calculus for solving general second order linear and nonlinear differential equations was presented. The derivation of this algorithm was essentially based on choosing a set of Legendre polynomials. The advantage of this technique over other methods is that it has less computational manipulations and complexities and also its availability for application on both linear and nonlinear second-order initial value problems. Other importance of the algorithm is that high accurate approximate solutions are achieved by using a few numbers of terms of the Legendre polynomial which result to simple matrix calculus and its transpose and thus, reduces the time involve in the derivation of the schemes to be used for implementation as compared to the case of linear multistep methods, more importantly the same matrix can be used to solve higher order differential equations by introducing just a little manipulation io it and also reduces the computational run time. The comparison of the results shows that the method is a very simple and efficient mathematical tool for solving initial value problems of differential equations.
Acknowledgments
The author expresses their sincere thanks to the referees for the careful and details reading of their earlier version of the paper and for the very helpful suggestions.
Author Contributions
Nathaniel Mahwash Kamoh: Conceptualization, Methodology, Project administration, Software, Writing – original draft, Writing – review & editing
Bwebum Cleofas Dang: Conceptualization, Methodology, Writing – original draft
Comfort Soomiyol Mrumun: Methodology, Project administration, Writing – original draft, Writing – review & editing
Conflicts of Interest
The authors declare no conflicts of interest.
References
[1] N. Z. Mukhtar, Z. Abdul Majid, F. Ismail and M. Suleiman (2012): Numerical Solution for Solving Second Order Ordinary Differential Equations Using Block Method. International Journal of Modern Physics Conference, Vol. 9. pp 560–565.
[2] Awoyemi, D. O. (2001). A New Sixth-Order Algorithm for General Second Order Ordinary Differential Equation. International Journal of Computational Mathematics, 77: 117-124.
[3] Awoyemi, D. O and Kayode, S. J. (2005). An Implicit Collocation Method for Direct Solution of Second Order ODEs. Journal of Nigeria Association of Mathematical Physics, 24: 70-78.
[4] Fatunla, S. O. (1995). A Class of Block Method for Second Order Initial Value Problems. International Journal of Computer Mathematics, 55(1&2): 119-133.
[5] Adesanya, A. O., Anake, T. A., Bishop, S. A. and Osilagun, J. A. (2009). Two Steps Block Method for the Solution of General Second Order Initial Value Problems of Ordinary Differential Equation. Journal of Natural Sciences, Engineering and Technology, 8(1): 25-33.
[6] Okunuga, S. A and Onumanyi, P. (1985). An Accurate Collocation Method for Solving Ordinary Differential Equations American Museum of Science and Energy Review, 4(4): 45-48.
[7] Jator, S. N. and Li, J. (2009). A Self-Starting Linear Multistep Method for a Direct Solution of the General Second-Order Initial Value Problem. International Journal of Computer Mathematics, 86(5): 827-836.
[8] Adesanya, A. O., Anake, T. A. and Udoh, M. O. (2008). Improved Continuous Method for Direct Solution of General Second Order Ordinary Differential Equations. Journal of the Nigeria Association of Mathematical Physics, 13: 59-62.
[9] Abdulnastr Isah and Chang Phang (2016): Operational matrix based on Genocchi polynomials for solution of delay differential equations. Ain Shams Engineering journal, 9(4), PP. 2123-2128.
[10] M. Sezer, (1996): A method for the approximate solution of the second order linear differential equations in terms of Taylor polynomials, Int. J. Math. Educ. Sci. Technol. 27, PP. 821–834.
[11] E. Tohidia, A. H. Bhrawy, K. Erfani (2013): A collocation method based on Bernoulli operational matrix for numerical solution of generalized pantograph equation. Applied Mathematical Modeling 37, PP. 4283–4294.
[12] Yunika Lestaria Ningsih and Anggria Septiani Mulbasari (2019): Exploring Students’ Difficulties in Solving Nonhomogeneous Second Order Ordinary Differential Equations with Initial Value Problems, Al-Jabar Jurnal Pendidikan Matematika, Vol. 10, No. 2, 2019, PP. 233–242.
[13] A. O. Adesanya, T. A. Anake, S. A. Bishop and J. A. Osilagu (2009): Two Steps Block Method for the Solution of General Second Order Initial Value Problems of Ordinary Differential Equation. Journal of Natural Sciences, Engineering and Technology, 8(1), 25-33.
[14] Zill, D. G. and Warren, W. S. (2013). Differential Equations with Boundary- Value Problems. Cengage Learning, books/Cole, eight editions. 664pp.
[15] Higham, N. J. (2004). The Numerical Stability of Barycentric Lagrange Interpolation. SIMA Journal of Numerical Analysis, 24: 547–556.
[16] W. M. Abd-Elhameed, Y. H. Youssri and E. H. Doha (2015): A novel operational matrix method based on shifted Legendre polynomials for solving second-order boundary value problems involving singular, singularly perturbed and Bratu-type equations, Math Sci (2015) 9: 93–102.
Cite This Article
  • APA Style

    Kamoh, N. M., Dang, B. C., Mrumun, C. S. (2024). An Effective Matrix Technique for the Numerical Solution of Second Order Differential Equations. Applied and Computational Mathematics, 13(4), 111-117. https://doi.org/10.11648/j.acm.20241304.15

    Copy | Download

    ACS Style

    Kamoh, N. M.; Dang, B. C.; Mrumun, C. S. An Effective Matrix Technique for the Numerical Solution of Second Order Differential Equations. Appl. Comput. Math. 2024, 13(4), 111-117. doi: 10.11648/j.acm.20241304.15

    Copy | Download

    AMA Style

    Kamoh NM, Dang BC, Mrumun CS. An Effective Matrix Technique for the Numerical Solution of Second Order Differential Equations. Appl Comput Math. 2024;13(4):111-117. doi: 10.11648/j.acm.20241304.15

    Copy | Download

  • @article{10.11648/j.acm.20241304.15,
      author = {Nathaniel Mahwash Kamoh and Bwebum Cleofas Dang and Comfort Soomiyol Mrumun},
      title = {An Effective Matrix Technique for the Numerical Solution of Second Order Differential Equations
    },
      journal = {Applied and Computational Mathematics},
      volume = {13},
      number = {4},
      pages = {111-117},
      doi = {10.11648/j.acm.20241304.15},
      url = {https://doi.org/10.11648/j.acm.20241304.15},
      eprint = {https://article.sciencepublishinggroup.com/pdf/10.11648.j.acm.20241304.15},
      abstract = {In this paper, an effective technique for solving differential equations with initial conditions is presented. The method is based on the use of the Legendre matrix of derivatives defined on the close interval [-1,1]. Properties of the polynomial are outlined and further used to obtain the matrix of derivative which was used in transforming the differential equation into systems of linear and nonlinear algebraic equations. The systems of these algebraic equations were then solved using Gaussian elimination method to determine the unknown parameters required for approximating the solution of the differential equation. The advantage of this technique over other methods is that, it has less computational manipulations and complexities and also its availability for application on both linear and nonlinear second-order initial value problems is impressive. Other advantage of the algorithm is that high accurate approximate solutions are achieved by using a greater number of terms of the Legendre polynomial and once the operational matrix is obtained, it can be used to solve differential equations of higher order by introducing just a little manipulation on the operational matrix. Some existing sample problems from literature were solved and the results were compared to show the validity, simplicity and applicability of the proposed method. The results obtained validate the simplicity and applicability of the method and it also reveals that the method perform better than most existing methods.
    },
     year = {2024}
    }
    

    Copy | Download

  • TY  - JOUR
    T1  - An Effective Matrix Technique for the Numerical Solution of Second Order Differential Equations
    
    AU  - Nathaniel Mahwash Kamoh
    AU  - Bwebum Cleofas Dang
    AU  - Comfort Soomiyol Mrumun
    Y1  - 2024/08/15
    PY  - 2024
    N1  - https://doi.org/10.11648/j.acm.20241304.15
    DO  - 10.11648/j.acm.20241304.15
    T2  - Applied and Computational Mathematics
    JF  - Applied and Computational Mathematics
    JO  - Applied and Computational Mathematics
    SP  - 111
    EP  - 117
    PB  - Science Publishing Group
    SN  - 2328-5613
    UR  - https://doi.org/10.11648/j.acm.20241304.15
    AB  - In this paper, an effective technique for solving differential equations with initial conditions is presented. The method is based on the use of the Legendre matrix of derivatives defined on the close interval [-1,1]. Properties of the polynomial are outlined and further used to obtain the matrix of derivative which was used in transforming the differential equation into systems of linear and nonlinear algebraic equations. The systems of these algebraic equations were then solved using Gaussian elimination method to determine the unknown parameters required for approximating the solution of the differential equation. The advantage of this technique over other methods is that, it has less computational manipulations and complexities and also its availability for application on both linear and nonlinear second-order initial value problems is impressive. Other advantage of the algorithm is that high accurate approximate solutions are achieved by using a greater number of terms of the Legendre polynomial and once the operational matrix is obtained, it can be used to solve differential equations of higher order by introducing just a little manipulation on the operational matrix. Some existing sample problems from literature were solved and the results were compared to show the validity, simplicity and applicability of the proposed method. The results obtained validate the simplicity and applicability of the method and it also reveals that the method perform better than most existing methods.
    
    VL  - 13
    IS  - 4
    ER  - 

    Copy | Download

Author Information