Graph theory is speedily moving into the mainstream of mathematics chiefly because of its applications in various fields such as computer science, biochemistry, operational research and electrical engineering [1, 2]. A graph polynomial is a function associated with a respective graph, to such an extent that a similar polynomial is allotted to graphs arising from a relabelling of the vertices. Many mathematicians and physicists are currently interested in the study of singular boundary and initial problems in the second-order ordinary differential equations (ODEs). We here considered the Lane-Emden (LE) equation formulated as
Where a,b,A,A1,B,B1 are constants, y″ and y′ are second and first derivatives, respectively. The majority of existing algorithms for dealing with LE-type models are grounded on series solutions or operational matrix methods. The subsequent approaches employed to crack the linear and nonlinear DEs are, ADM [3,4], DTM [5], the Laguerre wavelet scheme [6], the Clique polynomials technique [7], the new Ultraspherical wavelet collocation process [8], the Laguerre wavelets method [9], the Homotopy analysis method [10], the Legendre wavelet method [11], the Ebola Virus with Power Law Kernel method [12] and the Newell-Whitehead-Segal equation [13]. There are many approaches to solving differential equations. The collocation method is one of them.
In this study, we aim to provide an algorithm for the solution of DEs by graph theoretic polynomials. We considered the Hosoya polynomial of some trees which were given by D.Stevanovic and I.Gutman in [14] and used only linearly independent Hosoya polynomials to solve the differential equations. The suggested technique expresses the anticipated solution in the form of a linear combination of polynomials that are continuous across an interval. Nevertheless, compared to other methods for solving differential equations, the correctness and efficacy of this method relies on the proportions of the collection of Hosoya polynomials, and this process produces an easier and excellent agreement between the exact and approximate solutions obtained when the current scheme is used to solve linear and nonlinear models. Potentially, this method could be used in more intricate systems for which there are no exact solutions. Let (a,b) ⊂ R and q(x), p(x),r(x,y) : (a,b) → R be continuous real functions. Here, we study the singular ODEs given by,
The rest of this article is organized as follows. Section 2 presents some important properties of Hosoya polynomials. Section 3 introduces the function approximation formula being Hosayo polynomial method (HPM). Section 4 gives some theoretical results. Section 5 defines the scheme handled in this paper. Section 6 extracts some numerical results. In section 7, discussion and conclusion are reported in detail.
Let G be a graph with n vertices v1,v2,···,vn. A connected acyclic graph is called tree. The measurement of the shortest path connecting the vertices vi and vj is indicated by the symbol. The largest distance among any 2 vertices of a graph G is its diameter. W (G) denotes the Wiener Index of a connected graph G, which is pointed as the sum of the length between all unordered couples of vertices in G, that is,
The Hosoya polynomial gives sufficient evidence about distance-based graph invariants. For example, knowing the Hosoya polynomial of a graph makes it simple to compute the Wiener index as the first derivative of the polynomial at the point x = 1. In reference [19], Cash observed that the hyper-Wiener index is derived similarly from the Hosoya polynomial. Estrada et al. [20] used the Hosoya polynomial in chemical applications. Hosoya polynomials are investigated on trees [14, 16], composite graphs [21], benzenoid-graphs [22], tori [23], zig-zag nanotubes [22], certain-graph-decorations [24], arm-chair nanotubes [25], polyhex-nanotorus [26], TUC4C8(S) tubes [27] as well as on Lucas and Fibonacci cubes [28] and so on [29,30,31]. Trees up to five vertices and their Hosoya polynomials are given in Figure 1. One tree with one vertex One tree with two vertices One tree with three vertices.

Trees with different vertices.
The differential equation (2) solution is approximated as follows:
Let Rn−1 be an n-dimensional polynomial space over the field R and y : [a,b] → Rn−1 be the solution of the arbitrary second-order DE. Then the solution for such a DE by Hosoya polynomial method (HPM) is exact.
Let y(x) be the solution of second-order DE of degree at most n. If y(x) be any polynomial of degree n − 1 with real coefficients, then there is a subset S={1,x,Hn,2(G,x),···,Hn,n−1} that spans the n-dimensional space, where Hn,d is a Hosoya polynomial of degree d, where d = 2,3,···,n − 1.
Let
If S is the collection of all possible Hosoya polynomials of trees Tn on n vertices. Then there will be n − 2 linearly independent Hosoya polynomials.
If S = (H,n) be the gathering of all Hosoya polynomials of graphs of order n, that is,
Let S1(H,n) ={Hn,d(G,x)|Hn,d(G,x) = a0 + a1x + ··· + an−1xn−1,∀ai ∈ R} be the subset of S(H,n) and any two polynomials of S1(H,n) are not of the same degree. Therefore | S1(H,n) |= n − 2. Now we claim that S1(H,n) is linearly independent.
Consider
By approximating y(x) using Hosoya polynomials, we can transport a solution y(x) under Hosoya polynomial space as follows:
In this part of the paper, we investigate the governing models.
Let us study the LE equation in [9] as
The nonlinear Emden-Fowler (EF) kind problem in [3],
The corresponding approximate solution is given as
The nonlinear EF model is presented in [9] by
The nonlinear EF-type equation [8] can be written as:
Application 2 AE derived by HPM versus Exact solution.
| x | Exact Sol. | AE at n=7 | AE at n=8 | AE at n=9 | AE at n=10 |
|---|---|---|---|---|---|
| 0.1 | 0.990049833749168 | 2.82E-06 | 1.66E-08 | 4.74E-08 | 4.59E-09 |
| 0.2 | 0.960789439152323 | 1.16E-05 | 2.51E-07 | 1.12E-07 | 1.51E-09 |
| 0.3 | 0.913931185271228 | 1.93E-05 | 6.86E-08 | 1.48E-07 | 1.25E-08 |
| 0.4 | 0.852143788966211 | 9.73E-07 | 7.81E-07 | 1.45E-07 | 1.29E-08 |
| 0.5 | 0.778800783071405 | 2.56E-05 | 4.60E-07 | 1.35E-07 | 1.68E-08 |
| 0.6 | 0.697676326071031 | 2.74E-05 | 1.06E-06 | 1.91E-07 | 2.10E-08 |
| 0.7 | 0.612626394184416 | 4.21E-06 | 1.48E-06 | 8.39E-08 | 1.35E-08 |
| 0.8 | 0.527292424043049 | 3.43E-05 | 6.83E-07 | 2.40E-07 | 2.71E-08 |
| 0.9 | 0.444858066222941 | 1.58E-05 | 1.57E-06 | 2.89E-06 | 1.21E-08 |
| 1.0 | 0.367879441171442 | 8.55E-06 | 4.41E-07 | 7.74E-06 | 4.34E-09 |
Judgement of the AE of HPM and other techniques in [29].
| x | Exact Sol. | AE by method [29] | AE at n=10 |
|---|---|---|---|
| 0.1 | 0.990049833749168 | 4.89E-06 | 4.59E-09 |
| 0.2 | 0.960789439152323 | 6.84E-06 | 1.51E-09 |
| 0.3 | 0.913931185271228 | 8.03E-07 | 1.25E-08 |
| 0.4 | 0.852143788966211 | 8.38E-06 | 1.29E-08 |
| 0.5 | 0.778800783071405 | 1.28E-05 | 1.68E-08 |
| 0.6 | 0.697676326071031 | 5.32E-05 | 2.10E-08 |
| 0.7 | 0.612626394184416 | 2.06E-04 | 1.35E-08 |
| 0.8 | 0.527292424043049 | 5.93E-04 | 2.71E-08 |
| 0.9 | 0.444858066222941 | 1.41E-03 | 1.21E-08 |
| 1.0 | 0.367879441171442 | 3.07E-03 | 4.34E-09 |

Assessment of HPM solution with the exact solution at n = 10.
Application 3, AE derived by HPM versus Exact solution.
| x | Exact Sol. | AE at n=7 | AE at n=8 | AE at n=9 | AE at n=10 |
|---|---|---|---|---|---|
| 0.1 | -0.019900661706336 | 1.87E-05 | 1.87E-06 | 6.40E-06 | 1.75E-07 |
| 0.2 | -0.078441426306563 | 1.63E-05 | 1.63E-05 | 3.14E-07 | 2.71E-07 |
| 0.3 | -0.172355392482105 | 5.57E-05 | 5.57E-05 | 4.67E-07 | 2.95E-07 |
| 0.4 | -0.296840010236547 | 5.03E-05 | 5.03E-06 | 8.74E-07 | 4.93E-07 |
| 0.5 | -0.446287102628420 | 1.90E-05 | 1.90E-05 | 2.09E-07 | 3.04E-07 |
| 0.6 | -0.614969399495921 | 3.88E-06 | 3.88E-07 | 9.45E-07 | 1.10E-08 |
| 0.7 | -0.797552239914736 | 1.05E-05 | 1.05E-05 | 7.97E-07 | 1.06E-07 |
| 0.8 | -0.989392483672214 | 1.15E-05 | 1.15E-06 | 7.48E-07 | 8.61E-08 |
| 0.9 | -1.186653690555469 | 8.85E-06 | 8.85E-06 | 1.62E-06 | 7.51E-09 |
| 1.0 | -1.386294361119891 | 5.00E-06 | 5.00E-06 | 5.18E-05 | 1.54E-08 |

Plot of y1(x) compared with analytical solution.
AE comparison of the solution y1(x) with different values of n.
| x | Exact Sol. | AE at n=7 | AE at n=8 | AE at n=9 | AE at n=10 |
|---|---|---|---|---|---|
| 0.1 | 1.005004168055804 | 1.42E-08 | 1.39E-09 | 8.22E-11 | 3.56E-13 |
| 0.2 | 1.020066755619076 | 1.06E-08 | 1.89E-10 | 1.91E10 | 7.76E-13 |
| 0.3 | 1.045338514128861 | 1.79E-08 | 1.25E-09 | 2.71E-10 | 1.02E-12 |
| 0.4 | 1.081072371838455 | 2.42E-08 | 7.64E-10 | 3.43E-10 | 1.81E-13 |
| 0.5 | 1.127625965206381 | 1.05E-09 | 2.15E-09 | 4.37E-10 | 1.31E-12 |
| 0.6 | 1.185465218242268 | 2.31E-08 | 4.34E-10 | 5.27E-10 | 3.32E-13 |
| 0.7 | 1.255169005630943 | 7.97E-09 | 1.45E-09 | 6.02E-10 | 9.38E-13 |
| 0.8 | 1.337434946304845 | 2.82E-08 | 1.15E-10 | 6.52E-10 | 1.03E-12 |
| 0.9 | 1.433086385448775 | 2.38E-08 | 1.74E-09 | 4.86E-10 | 4.34E-13 |

Plot of y1(x) obtained by the HPM at n = 10 for equation (12).
We proposed the Hosayo polynomial method to solve nonlinear initial and boundary value models. Nonlinear ODEs are transformed into a nonlinear system of algebraic equations with this method. To obtain a numerical solution, these equations are solved using Newton’s Raphson technique. The developed technique is evaluated on some applications, and the results compare favourably with the current numerical results. Finally, we recap the findings of our study as follows;
* In comparison to other existing numerical algorithms, the considered scheme provides greater accuracy.
* This strategy is simple to adopt in computer programs, and we can upgrade it to higher-order functions with a minor change to the current method.
* Theorem 1 demonstrates that the proposed technique will provide an exact solution for DEs whose solutions are in the polynomial form of finite degree, as shown in application 1.
It is advised that this method may be used to observe other nonlinear initial and boundary value problems.
The authors have no competing interests to declare that are relevant to the content of this article.
No funding was received to assist with the preparation of this manuscript.
K.S.- Conceptualization, Methodology, Software. H.S.R.- Writing-Review Editing. R.A.M.-Formal Analysis, Validation, Writing-Original Draft. R.B.J.-Methodology, Software. All authors read and approved the final submitted version of this manuscript.
The authors deeply appreciate the anonymous reviewers for their helpful and constructive suggestions, which can help further improve this paper.
All data that support the findings of this study are included within the article.
The authors declare that they have not used Artificial Intelligence (AI) tools in the creation of this article.