The document applies the variational iteration method (VIM) to solve linear and nonlinear ordinary differential equations (ODEs) with variable coefficients. It emphasizes the power of the method by using it to solve a variety of ODE models of different orders and coefficients. The document also uses VIM to solve four scientific models - the hybrid selection model, Thomas-Fermi equation, Kidder equation for unsteady gas flow through porous media, and the Riccati equation. The VIM provides efficient iterative approximations for both analytic solutions and numeric simulations of real-world applications in science and engineering.
2. A.-M. Wazwaz
sumptions for the nonlinear terms which would complicate
the analytic calculations. The VIM approaches linear and
nonlinear problems directly in a like manner.
The aim of this work is two folds. First we aim to apply the
VIM in a unified fashion to the linear and nonlinear ODEs
with variable coefficients of a variety of distinct orders.
Second we aim to confirm the reliability of the method
in handling scientific problems, namely, hybrid selection
model, the Thomas-Fermi equation, the Kidder equation
of the Unsteady flow of gas through a porous medium, and
the Riccati equation. Because a vast amount of research
work was used in using this method, we only present the
main steps of the method.
2. The variational iteration method
Consider the differential equation
Lu + Nu = g(x), (1)
where L and N are linear and nonlinear operators respec-
tively, and g(x) is the source inhomogeneous term. The
variational iteration method admits the use of a correction
functional for equation (1) in the form
un+1(x) = un(x) +
Z x
0
λ(t)
(Lun(t) + N ũn(t) − g(t)) dt, (2)
where λ is a general Lagrange’s multiplier, which can be
identified optimally via the variational theory, and ũn as a
restricted variation which means δũn = 0. The Lagrange
multiplier λ is crucial and critical in the method, and it can
be a constant or a function. Having λ determined, an iter-
ation formula should be used for the determination of the
successive approximations un+1(x), n ≥ 0 of the solution
u(x). The zeroth approximation u0 can be any selective
function. However, using the initial values u(0), u
0
(0), and
u
00
(0) are preferably used for the selective zeroth approxi-
mation u0 as will be seen later. Consequently, the solution
is given by
u(x) = lim
n→∞
un(x). (3)
It is interesting to point out that we formally derived the
distinct forms of the Lagrange multipliers λ in [1], hence
we skip details. We only set a summary of the obtained
results:
For first order ODE of the form
u
0
+ p(x)u = q(x), u(0) = α, (4)
it was found that λ = −1, and the correction functional
gives the iteration formula
un+1(x) = un(x) −
Z x
0
u
0
n(t) + p(t)un(t) − q(t)
dt, (5)
For the second-order ODE
u
00
(x) + au
0
(x) + bu(x) = g(x),
u(0) = α, u
0
(0) = β, (6)
it was found that λ = t − x and the correction functional
gives the iteration formula
un+1(x) = un(x) +
Z x
0
(t − x)
u
00
n(t) + au
0
n(t) + bun(t) − g(t)
dt, (7)
Moreover, for the third-order ODE
u
000
+au
00
+bu
0
+cu = g(x), u(0) = α, u
0
(0) = β, u
00
(0) = γ,
(8)
we found that λ = − 1
2!
(t − x)2
, and the iteration formula
takes the form
un+1(x) = un(x) −
1
2!
Z x
0
(t − x)2
u
000
n (t) + au
00
n(t) + bu
0
n(t) + cun(t) − g(t)
dt, (9)
Generally, for the nth-order ODE
u(n)
+ f(u, u0
, u00
, · · · , u(n−1)
) = g(x), u(0) =
α0, u
0
(0) = α1, · · · , u(n−1)
(0) = αn−1, (10)
we found that λ = (−1)n
(n−1)!
(t−x)n−1
, and the iteration formula
takes the form
un+1(x) = un(x) +
(−1)n
(n − 1)!
Z x
0
(t − x)n−1
u(n)
+ f(u, u0
, u00
, · · · , u(n−1)
) − g(t)
dt, (11)
Although the zeroth approximation u0(x) is any selective
function, but it is preferable to select it in the form
u0(x) = u(0) + u0
(0)x +
1
2!
u
00
(0)x2
+ · · · +
1
n − 1
u(n−1)
(0)xn−1
, (12)
where n is the order of the ODE.
In what follows we present the following illustrative ex-
amples. We will examine a variety of linear and nonlinear
ODEs with variable coefficients.
65
3. The variational iteration method for solving linear and nonlinear ODEs and scientific models with variable coefficients
3. Scientific applications
In this section we will focus our work on four well known
nonlinear equations, namely the hybrid selection model,
the Thomas-Fermi equation, the Kidder equation of the
Unsteady flow of gas through a porous medium, and the
Riccati equation. The exact solution cannot be found for
the second and the third models, therefore we will study
the physical structure of the obtained series solutions.
3.1. The hybrid selection model
We first study the hybrid selection model with constant
coefficients that reads
u
0
= ku(1 − u)(2 − u), u(0) = 0.5, (13)
where k is a positive constant that depends on the genetic
characteristic. In the hybrid model, u(t) is the portion of
population of a certain characteristic, and t is the time
measured in generations.
This is a first order ODE, hence the Lagrange multiplier
is given by λ = −1, and we can set u0 = 1
2
. The VIM
admits the use of the iteration formula
un+1(t) = un(t) −
Z t
0
u
0
n(s) − kun(s)(1 − un(s))(2 − un(s))
ds, n ≥ 0. (14)
This in turn gives the successive approximations
u0(t) = 1
2
,
u1(t) = u0(t) −
R t
0
u
0
0(s) − ku0(s)(1 − u0(s))(2 − u0(s))
ds =
1
2
+ 3
8
kt,
u2(t) = u1(t) −
R t
0
u
0
1(s) − ku1(s)(1 − u1(s))(2 − u1(s))
ds
= 1
2
+ 3
8
kt − 3
64
(kt)2
− 9
128
(kt)3
− 27
2048
(kt)4
,
u3(t) = u2(t) −
R t
0
u
0
2(s) − ku2(s)(1 − u2(s))(2 − u2(s))
ds
= 1
2
+ 3
8
kt − 3
64
(kt)2
−
17
256
(kt)3
− 63
2048
(kt)4
+ 27
2560
(kt)5
+ · · · ,
u4(t) = u3(t) −
R t
0
u
0
3(s) − ku3(s)(1 − u3(s))(2 − u3(s))
ds
= 1
2
+ 3
8
kt − 3
64
(kt)2
−
17
256
(kt)3
− 125
4096
(kt)4
+ 721
81920
(kt)5
+ · · · ,
.
.
. .
(15)
Figure 1. The solution u(t) for k = 0.25, and 0 ≤ x ≤ 20.
This in turn gives the exact solution
u(t) =
√
1 + 3e3kt − 1
√
1 + 3e3kt
. (16)
The solution u(t) is an increasing function bounded by
u = 1, where we find
lim
t→∞
u(t) = 1. (17)
Figure 1 shows the solution u(t).
3.2. The Thomas-Fermi equation
In this section we will examine the Thomas-Fermi equation
y
00
=
y
3
2
x
1
2
, (18)
This problem was developed to model the effective nuclear
charge in heavy atoms [3]. The Thomas-Fermi model (18)
was derived to study the potentials and charge densities
of atoms having numerous electrons. Our study will focus
on the common case of boundary conditions given by
y(0) = 1, lim
x→∞
y(x) = 0. (19)
66
4. A.-M. Wazwaz
It is to be noted that other relevant boundary conditions
are used in the literature. The potential y0
(0) = B will be
determined using the diagonal Padé approximants of the
obtained series.
To overcome the difficulty of the fractional exponent of
y(x), we use the transformation
y(x) = 1 + u(x), (20)
that carries (18) to
u
00
=
(1 + u)
3
2
x
1
2
, (21)
with initial conditions
u(0) = 0, u0
(0) = B. (22)
Note that in using the VIM we will use the approximation
(1 + u)
3
2 ≈ 1 +
3
2
u +
3
8
u2
−
1
16
u3
. (23)
Proceeding as before, and for simplicity we derived the
approximations up to u3(x). Substituting x = t2
in u3(x)
and using (20) we obtain
y(t) = 1 + B t2
+
4
3
t3
+
2 B
5
t5
+
1
3
t6
+
3 B2
70
t7
+
2 B
15
t8
+ (
2
27
−
B3
252
) t9
+
B2
175
t10
+ (
1
1056
B4
+
31 B
1485
) t11
+ (
4
1575
B2
+
4
405
) t12
+ (−
3
9152
B5 557
100100
B2
) t13
+ (−
29
24255
B4
−
4
693
B) t14
+ (−
29
40950
−
4
405
) t15
+ (−
224353
100900800
B2
+
1
75264
B5
) t16
+ − 3
43520
B7
+ 153173
116424000
B4
− 113
1178100
B
t17
+ − 4
10395
B6
= 1046
675675
B3
+ 23
473850
t18
+ (− 1232942
1278076800
B5
+ 799399
698377680
B2
)t19
+ (− 99856
70935875
B4
= 51356
103378275
B)t20
+ O(t21
).
(24)
To determine the potential y0
(0) = B, we follow our ap-
proach in [2] and by substituting the condition limt→∞ y =
0 in the Padé approximants, we obtain the results shown
in Table 1 below. Tables 1 summarizes the initial slopes
y
0
(0) and the Padé approximants.
Figure 2. Padé approximant [11/11] for 0 ≤ t ≤ 4.
Table 1
Initial slopes B = u
0
(0) for various Padé approximants
Padé approximants y
0
(0) = B
[2/2] -1.211413731
[4/4] -1.550525923
[7/7] -1.586021038
[8/8] -1.588076823
[10/10] -1.588076781
The results are consistent with the results obtained in [2].
It is to be noted that y(x) is a decreasing function, hence
y0
(x) 0. Fig 2 below shows the decreasing function for
y(x) by using the diagonal Padé approximant [11/11].
3.3. Unsteady flow of gas through a porous
medium
In this section we will establish an analytic solution to
the nonlinear ordinary differential equation due to Kidder
[3,9] given by
u
00
(x) +
2x
√
1 − αu
u
0
(x) = 0, 0 α 1, (25)
with typical boundary conditions imposed by the physical
properties that read
u(0) = 1, lim
x→∞
u(x) = 0. (26)
67
5. The variational iteration method for solving linear and nonlinear ODEs and scientific models with variable coefficients
Table 1. Initial slopes B = u
0
(0) for various values of α
α B[2/2] = y
0
(0) B[3/3] = y
0
(0)
0.1 -3.556558821 - 1.957208953
0.2 -2.441894334 - 1.786475516
0.3 -1.928338405 - 1.478270843
0.4 -1.606856838 - 1.231801809
0.5 -1.373178096 -1.025529704
0.6 -1.185519607 -0.8400346085
0.7 -1.021411309 - 0.6612047893
0.8 -0.8633400217 -0.4776697286
0.9 -0.6844600642 - 0.2772628386
The Kidder equation (25) appears in the problem of the
transient flow of gas within a one-dimensional semi-
infinite porous medium. In [9], the analytic solution was
constructed by employing a perturbation technique that
was carried to terms of the second order. Moreover, it was
shown that the complexity of the calculations increases
rapidly with increasing order of terms beyond the sec-
ond order term. In [3], the modified decomposition method
combined with the diagonal Padé approximants were used
to enhance the approximations over existing techniques.
The potential u0
(0) = B will be determined using the di-
agonal Padé approximants of the obtained series.
To overcome the difficulty of the nonlinear term 1
√
1−αy
,
we use the transformation
1
√
1 − αu
≈ 1 +
1
2
(αu) +
3
8
(αu)2
+
5
16
(αu)3
. (27)
Proceeding as before, and for simplicity we list the ob-
tained approximation by
u(x) = 1 + Bx −
B
3
√
1 − α
x3
−
α B2
12(1 − α)
3
2
x4
+
B
10(1 − α)
−
3α2
B3
80(1 − α)
5
2
!
x5
+
α B2
15(1 − α)2
−
α3
B4
48(1 − α)
7
2
!
x6
+ · · ·
.
.
. .
(28)
To determine the potential u0
(0) = B, we follow our ap-
proach in [3] and by substituting the condition limt→∞ u =
0 in the Padé approximants, we obtain the results shown
in Table 2 below. Tables 2 summarizes the initial slopes
u
0
(0) and the Padé approximants.
It is obvious that the initial slope B = y
0
(0) depends
mainly on the parameter α, where 0 α 1. Table
Figure 3. Padé approximant [3/3] for 0 ≤ x ≤ 1, α = 0.
2 shows that the initial slope B = y
0
(0) increases with
the increase of α. Fig. 2 below shows the [3/3] Padé
approximant of the approximation (28).
3.4. The Riccati equation
We close our study by applying the VIM to the Riccati
equation [1]
u
0
= u2
− 2xu + x2
+ 1, u(0) =
1
2
. (29)
Proceeding as before, we set λ = −1, and use u0 = 1.
This leads to the iteration formula
un+1(x) = un(x)−
Z x
0
(u
0
n(t)−u2
n+2tun(t)−t2
−1)dt, n ≥ 0,
(30)
68
6. A.-M. Wazwaz
that gives the successive approximations
u1(x) = u0(x) −
R x
0
(u
0
0(t) − u2
0 + 2tu0(t) − t2
− 1)dt
= 1
2
+ 5
4
x − 1
2
x2
+ 1
3
x3
,
u2(x) = u1(x) −
R x
0
(u
0
1(t) − u2
1 + 2tu1(t) − t2
− 1)dt
= 1
2
+ 5
4
x + 1
8
x2
− 7
48
x3
+ 1
28
x4
+ 1
12
x5
+ · · · ,
u3(x) = u2(x) −
R x
0
(u
0
2(t) − u2
2 + 2tu2(t) − t2
− 1)dt
= 1
2
+ 5
4
x + 1
8
x2
+ 1
16
x3
− 1
48
x4
− 7
960
x5
+ · · · ,
u4(x) = u3(x) −
R x
0
(u
0
3(t) − u2
3 + 2tu3(t) − t2
− 1)dt
= 1
2
+ 5
4
x + 1
8
x2
+ 1
16
x3
+ 1
32
x4
+ 1
64
x5
+ · · · ,
.
.
.
un(x) = x + 1
2
(1 + 1
2
x + 1
4
x2
+ 1
8
x3
+ 1
16
x4
+ 1
32
x5
+ · · · ),
(31)
that converges to the exact solution
u(x) = x +
1
2 − x
, |x| 2. (32)
4. A variety of ODEs with different
orders
4.1. First order ODEs
We start our analysis by studying the following first order
nonlinear ODE
u
0
+ ex
u + e−x
u3
= ex
+ 2e2x
, u(0) = 1. (33)
To use the VIM method, we follow the discussion pre-
sented above,use λ = −1, and we can set u0 = 1. There-
fore, the iteration formula is given by
un+1(x) = un(x)−
Z x
0
(u
0
n(t)+et
un(t)+e−t
u3
n(t)−et
−2e2t
)dt, n ≥ 0.
(34)
This in turn gives the successive approximations
u0(x) = 1,
u1(x) = u0(x) −
R x
0
(u
0
0(t) + et
u0(t) + e−t
u3
0(t) − et
− 2e2t
)dt
= 1 + x + 5
2
x2
+ 7
6
x3
+ 17
24
x4
+ 31
120
x5
+ · · · ,
u2(x) = u1(x) −
R x
0
(u
0
1(t) + et
u1(t) + e−t
u3
1(t) − et
− 2e2t
)dt
= 1 + x + 1
2
x2
− 5
2
x3
− 71
24
x4
− 181
40
x5
+ · · · ,
u3(x) = u2(x) −
R x
0
(u
0
2(t) + et
u2(t) + e−t
u3
2(t) − et
− 2e2t
)dt
= 1 + x + 1
2
x2
+ 1
3!
x3
+ 65
24
x4
+ 109
24
x5
+ · · · ,
u4(x) = u3(x) −
R x
0
(u
0
3(t) + et
u3(t) + e−t
u3
3(t) − et
− 2e2t
)dt
= 1 + x + 1
2
x2
+ 1
3!
x3
+ 1
4!
x4
− 18
7
x5
+ · · · ,
.
.
. ,
un(x) = 1 + x + 1
2!
x2
+ 1
3!
x3
+ 1
4!
x4
+ 1
5!
x5
+ · · · .
(35)
Recall that the exact solution is given by
u(x) = lim
n→∞
un(x). (36)
This in turn gives the exact solution
u(x) = ex
. (37)
4.2. Second order ODEs
We next extend this work to the second order linear ODE
with variable coefficients
u
00
(x) − 2xu
0
(x) − 2u(x) = x, u(0) = 1, u
0
(0) = −
1
4
. (38)
Following the discussion presented above we find that
λ = t − x, and we can set u0 = 1 − 1
4
x. Therefore, the
iteration formula is given by
un+1(x) = un(x) +
Z x
0
(t − x)(u
00
n(t) − 2tu
0
n(t) − 2un(t) − t)dt, n ≥ 0. (39)
69
7. The variational iteration method for solving linear and nonlinear ODEs and scientific models with variable coefficients
This in turn gives the successive approximations
u0(x) = 1 − 1
4
x,
u1(x) = u0(x) +
R x
0
(t − x)
(u
00
0(t) − 2tu
0
0(t) − 2u0(t) − t)dt =
1 − 1
4
x + x2
,
u2(x) = u1(x) +
R x
0
(t − x)
(u
00
1(t) − 2tu
0
1(t) − 2u1(t) − t)dt =
1 − 1
4
x + x2
+ 1
2!
x4
,
u3(x) = u2(x) +
R x
0
(t − x)
(u
00
2(t) − 2tu
0
2(t) − 2u2(t) − t)dt =
1 − 1
4
x + x2
+ 1
2!
x4
+ 1
3!
x6
,
.
.
. ,
un(x) = 1 − 1
4
x + x2
+ 1
2!
x4
+ 1
3!
x6
+ 1
4!
x8
+ · · · .
(40)
Using the fact that the exact solution is obtained by using
u(x) = lim
n→∞
un(x). (41)
This in turn gives the exact solution
u(x) = ex2
−
1
4
x. (42)
4.3. Third order ODEs
We now consider the third order nonlinear ODE with con-
stant coefficients given by
u
000
+
3
1 + x
(u
0
)2
= e3u
, u(0) = 0, u
0
(0) = −1, u
00
(0) = 1, x ≥ 0.
(43)
Using the discussion presented above we find that λ =
− 1
2!
(t − x)2
, and we can set u0 = −x + 1
2
x2
. Therefore,
the iteration formula is given by
un+1(x) = un(x) −
1
2!
Z x
0
(t − x)2
u
000
n (t) −
3
1 + t
(u
0
n)2
(t) − e3un(t)
dt, n ≥ 0. (44)
Proceeding as before we obtain the following successive
approximations
u0(x) = −x + 1
2
x2
,
u1(x) = u0(x) − 1
2
R x
0
(t − x)2
u
000
0 (t) − 3
1+t
(u
0
0)2
(t) − e3u0(t)
dt
= −x + 1
2
x2
− 1
3
x3
+ 1
4
x4
− 1
10
x5
+ 1
40
x6
+ · · · ,
u2(x) = u1(x) − 1
2
R x
0
(t − x)2
u
000
1 (t) − 3
1+t
(u
0
1)2
(t) − e3u1(t)
dt
= −x + 1
2
x2
− 1
3
x3
+ 1
4
x4
− 1
5
x5
+ 1
6
x6
+ · · · ,
.
.
. ,
un(x) = −x + 1
2
x2
− 1
3
x3
+
1
4
x4
− 1
5
x5
+ 1
6
x6
− 1
7
x7
+ · · · ,
(45)
where we used the Taylor expansion for e3u
.
Consequently, the exact solution is given by
u(x) = − ln(1 + x). (46)
4.4. Fourth order ODEs
We next consider the fourth order nonlinear ODE with
constant coefficients given by
u(iv)
− sin x u
00
+ uu0
− u = −1 − sin x,
u(0) = 2, u
0
(0) = 0, u
00
(0) = −1, u
000
(0) = 0. (47)
In this case, the Lagrange multiplier λ = 1
3!
(t − x)3
, and
we can set u0 = 2 − 1
2
x2
. Therefore, the iteration formula
reads
un+1(x) = un(x) +
1
3!
Z x
0
(t − x)3
u(iv)
n (t) − sin t u
00
n(t)+
un(t)u
0
n(t) − un(t) + sin t + 1
dt. (48)
70
8. A.-M. Wazwaz
Proceeding as before we obtain the following successive
approximations
u0(x) = 2 − 1
2
x2
,
u1(x) = u0(x) + 1
3!
R x
0
(t − x)3
u
(iv)
0 (t) − sin t u
00
0(t)
+u0(t)u
0
n(t) − u0(t) + sin t + 1
dt
= 2 − 1
2
x2
+ 1
4!
x4
− 1
6!
x6
− 1
7!
x7
+ · · · ,
u2(x) = u1(x) + 1
3!
R x
0
(t − x)3
u
(iv)
1 (t) − sin t u
00
1(t)
+u1(t)u
0
n(t) − u1(t) + sin t + 1
dt
= 2 − 1
2!
x2
+ 1
4!
x4
−
1
6!
x6
+ 1
8!
x8
+ · · · ,
.
.
. ,
un(x) = 2 − 1
2!
x2
+ 1
4!
x4
−
1
6!
x6
+ 1
8!
x8
− 1
10!
x10
+ · · · ,
(49)
The exact solution
u(x) = 1 + cos x, (50)
follows immediately.
5. Discussions
In this work we applied the variational iteration method to
ODEs of distinct orders and with variable coefficients. We
applied the method to scientific applications as well. We
presented the analysis of several cases beginning from the
first-order through the fourth-order linear and nonlinear
differential equations, inclusively. The illustrative exam-
ples, that we examined, show that the VIM is reliable and
efficient over existing techniques.
It is obvious that the method gives rapid convergent suc-
cessive approximations without any restrictive assump-
tions or transformation that may change the physical be-
havior of the problem. The variational iteration method
gives several successive approximations through using
the iteration of the correction functional. For nonlin-
ear equations that arise frequently to express nonlinear
phenomenon, the variational iteration method facilitates
the computational work and gives the solution rapidly if
compared with Adomian method. For nonlinear problems
where exact solution does not exist, a few number of ap-
proximations can be used for numerical purposes such as
the Thomas-Fermi equation and the Kidder equation.
References
[1] A. M. Wazwaz, The variational iteration method for an-
alytic treatment for linear and nonlinear ODEs, Appl.
Math. Comput., 212 (1) (2009) 120–134.
[2] A.M. Wazwaz, The modified decomposition method
and Padé approximants for solving the Thomas–Fermi
equation, Appl. Math. Comput., 105 (1999) 11–19.
[3] A.M.Wazwaz, The modified decomposition method ap-
plied to unsteady flow of gas through a porous medium,
Applied Mathematics and Computation, 118(2/3)
(2001) 123–132.
[4] J.H.He, Variational iteration method for autonomous
ordinary differential systems, Appl. math. Comput.,
114(2/3) (2000) 115–123.
[5] J.H. He, Variational iteration method - Some recent
results and new interpretations, J. Comput. Appl. Math.,
207(1)( 2007) 3–17.
[6] H.T. Davis, Introduction to Nonlinear Differential and
Integral Equations, Dover Publications, New York,
(1962).
[7] H. Carslaw and J. Jaeger, Conduction of Heat in Solids,
Oxford, London (1947).
[8] R. C. Roberts, Unsteady flow of gas through a porous
medium Proceedings of the first U.S National Congress
of Applied Mechanics, Ann Arbor, Mich., 773 – 776
(1952).
[9] R. E. Kidder, Unsteady flow of gas through a semi-
infinite porous medium, Journal of Applied Mechanics,
27 (1067) 329 – 332.
71