# Solving Ordinary Differential Equation Using Least Square Method and Conjugate Gradient Method

### Abstract

This study all about to solve the problem of nonhomogeneous Ordinary differential equation with boundary value theorem (BVP). Because it is commonly appeared in range of field and profession such as engineering and physics. The theoretical method used to solve this problem is undetermined coefficient. Besides, this theoretical method is really complicated to understand and it will take a long time to solve the problems. Then this study proceeds to solve the problems using the numerical methods which are the Least Square Method (LSM) and another method is Conjugate Gradient (CG). CG is used to solve the inverse matrix to avoid ill-conditioned matrix. Numerical solution will show that Least Square Method can solved second-order nonhomogeneous ordinary differential equation with BVP based on term of the error analysis made by theoretical method which is undetermined coefficient. Finally, this study shows that the theoretical method and numerical methods almost lie in the same line when the solutions plotted on the same graph.

### References

equations in arbitrary shaped domains using cartesian cut-stencil finite difference method. part

i: Concepts and fundamentals,” Numer. Math., vol. 13, no. 4, pp. 881–907, 2020.

[2] Ab Aziz, A., Baki, N. A., Haziq, M. A., “Comparative Study of Bisection, Newton, Horner’s

Method for Solving Nonlinear Equation,” J. Ocean. Mech. Aerosp. -science Eng., vol. 65, no.

2, pp. 36–39, 2021.

99

[3] P. Wang, X. Wu, and H. Liu, “Higher order convergence for a class of set differential equations

with initial conditions,” Discret. Contin. Dyn. Syst. - Ser. S, vol. 14, no. 9, pp. 3233–3248, 2021.

[4] E. P. Artashkin, “Bisection Method,” Apriori. Cерия Естественные И Технические Науки,

no. 6, p. 4, 2016.

[5] M. L. Abell and J. P. Braselton, “Introduction to differential equations,” in Differential Equations

with Mathematica, 2023, pp. 1–28.

[6] D. Kaschek and J. Timmer, “A variational approach to parameter estimation in ordinary

differential equations,” BMC Syst. Biol., vol. 6, 2012.

[7] S. M. Filipov, I. D. Gospodinov, and I. Faragó, “Shooting-projection method for two-point

boundary value problems,” Appl. Math. Lett., vol. 72, pp. 10–15, 2017.

[8] D. Zwillinger and V. Dobrushkin, Handbook of differential equations. 2021.

[9] K. W. Morton and D. F. Mayers, Numerical solution of partial differential equations: An

introduction. 2005.

[10] M. L. Abell and J. P. Braselton, “Introduction to differential equations,” in Differential Equations

with Mathematica, 2023, pp. 1–28.

[11] D. Mortari, “Least-squares solution of linear differential equations,” Mathematics, vol. 5, no. 4,

2017.

[12] I. A. Masmali, Z. Salleh, and A. Alhawarat, “A decent three term conjugate gradient method

with global convergence properties for large scale unconstrained optimization problems,”

AIMS Math., vol. 6, no. 10, pp. 10742–10764, 2021.

[13] M. Esmaeilzadeh, R. M. Barron, and R. Balachandar, “Numerical solution of partial differential

equations in arbitrary shaped domains using cartesian cut-stencil finite difference method. part

i: Concepts and fundamentals,” Numer. Math., vol. 13, no. 4, pp. 881–907, 2020.

[14] K. Thirumurugan, “A new method to compute the adjoint and inverse of 3×3 non-singular

matrices,” Int. J. Math. Stat. Invent., vol. 2, no. 10, pp. 52–55, 2014.

[15] A. S. Ahmed, H. M. Khudhur, and M. S. Najmuldeen, “A new parameter in three-term conjugate

gradient algorithms for unconstrained optimization,” Indones. J. Electr. Eng. Comput. Sci., vol.

23, no. 1, pp. 338–344, 2021.

**Mathematical Sciences and Informatics Journal**, [S.l.], v. 3, n. 2, p. 93-100, nov. 2022. ISSN 2735-0703. Available at: <https://myjms.mohe.gov.my/index.php/mij/article/view/17738>. Date accessed: 02 oct. 2023. doi: https://doi.org/10.24191/mij.v3i2.17738.