Equation (10) can be changed to the following equivalent form
$$\begin{aligned} w''(t)w^2(t)+2\lambda {(t-1)tw'(t)}+[(1-3\lambda )t+2\lambda ]w(t)=0,\quad t\in [\beta ,1), \end{aligned}$$
(13)
subject to the boundary conditions
$$\begin{aligned} w(1)& = {} 0, \end{aligned}$$
(14)
$$\begin{aligned} w'(\beta )& = {} \frac{\;-2\lambda (1-\beta )\beta \;}{\;w(\beta )\;}. \end{aligned}$$
(15)
In this paper, the numerical solution of Eq. (13) with boundary conditions (14, 15) is based on the the finite difference method. The interval \([\beta , 1]\) is divided into N subintervals with step size \(h=\frac{\;1-\beta \;}{\;N\;}\), and define \(t_{j}=\beta +jh\) for \(j=0, 1, \ldots , N\). Let \(w_j\) denotes the values of \(w(t_{j})\) for \(j=0, 1, \ldots , N\). Let \(t=t_{j}\), the finite difference formulation of Eq. (13) writes as
$$\begin{aligned} \frac{\;w_{j+1}-2w_{j}+w_{j-1}\;}{\;h^2\;}w^2_{j} + 2\lambda (t_{j}-1)t_{j}\frac{\;w_{j+1}-w_{j-1}\;}{\;2h\;}+ \big [(1-3\lambda )t_{j}+2\lambda \big ]w_{j}=0, \end{aligned}$$
(16)
for \(j=1, 2, \ldots , N-1\). The boundary condition (14) corresponds to
$$\begin{aligned} w_{N}=0. \end{aligned}$$
(17)
And the discretization of boundary condition (15) reads as
$$\begin{aligned} \frac{\;w_{1}-w_{0}\;}{\;h\;}w_{0} +2\lambda (1-\beta )\beta =0. \end{aligned}$$
(18)
The discretization formulation (16–18) is a nonlinear equation system, so Newton iteration method is recommended to solve approximate solutions. We now proceed to describe the iterative process for the solution of the nonlinear system (16–18). Let \({\mathbf{w}}^{T}=[w_{0}\quad \cdots \quad w_{N}]\), and
$$\begin{aligned} {\mathbf{H}}({\mathbf{w}};\lambda )=\left[ \begin{array}{ll} H_{0}({\mathbf{w}};\lambda )\\ \qquad \vdots \\ H_{N-1}({\mathbf{w}};\lambda ) \end{array}\right] , \end{aligned}$$
(19)
where
$$\begin{aligned} H_{0}({\mathbf{w}};\lambda )=w_{0}w_{1}-w^2_{0}+2h\lambda (1-\beta )\beta , \end{aligned}$$
(20)
and
$$\begin{aligned} H_{j}({\mathbf{w}};\lambda )=(w_{j+1}-2w_{j}+w_{j-1})w^2_{j} +\lambda {h}(t_{j}-1)t_{j}(w_{j+1}-w_{j-1})+ \big [(1-3\lambda )t_{j}+2\lambda \big ]h^2 w_{j}, \end{aligned}$$
(21)
for \(j=1, 2, \ldots , N-1\).
The solving Eqs. (16–18) is equivalent to solving the system described by
$$\begin{aligned} {\mathbf{H}}({\mathbf{w}};\lambda )={\mathbf 0} . \end{aligned}$$
(22)
Newton’s iteration method is recommended to solve nonlinear system (22). Given \(\lambda \) and initial values \(w_{j}^{0}, j=0,1,2,\ldots , N\), the k-th Newton’s iterates \({\mathbf{w} }^{k}=[w_{0}^k,w_{1}^k, \ldots \quad w_{N}^k]^T,k=1,2,\ldots ,\) can be obtained by solving system (22). Newton’s method for the solution of Eq. (22) proceeds to yield subsequent iterates for w as
$$\begin{aligned} {\mathbf{w}}^{k+1}={\mathbf{w}}^{k}+\triangle {\mathbf{w}}^{k}, \end{aligned}$$
(23)
where \(\triangle {\mathbf{w}}^{k}\) satisfies the equation
$$\begin{aligned} {\mathbf{J}}_{{\mathbf{H}}}({\mathbf{w}})\triangle {\mathbf{w}}^{k}=-{\mathbf{H}}({\mathbf{w}}^k;\lambda ). \end{aligned}$$
(24)
The iterative process described by Eqs. (23, 24) may be repeated in succession until \(\Vert \triangle {\mathbf{w}}^{k}\Vert _{\infty }<\varepsilon \) for some prescribed error tolerance \(\varepsilon \).
The algorithm is then given as:
-
Step 1.
Input the values \(\lambda \), number of subintervals N and stopping condition \(\varepsilon \)
-
Step 2.
Initialize \(\beta \),\(k\leftarrow 0\), step size \(h \leftarrow \frac{1-\beta }{N}\) and \({\mathbf{w}}_{N}\leftarrow {\mathbf 0} \),
-
Step 3.
Compute \({\mathbf{w}}^{k}, \triangle {\mathbf{w}}^{k}\) by Eqs. (23, 24); \(k\leftarrow k+1\)
-
Step 4.
Repeat through step 3 until \(\Vert \triangle {\mathbf{w}}^{k}\Vert _{\infty }<\varepsilon \) is satisfied.