To illustrate the basic ideas of the homotopy analysis method, we consider the following nonlinear differential equation:

$A(u)-f(r)=0,\phantom{\rule{1em}{0ex}}r\in \mathrm{\Omega}$

(1)

with the boundary conditions

$B(u,\frac{\partial u}{\partial n})=0,\phantom{\rule{1em}{0ex}}r\in \mathrm{\Gamma},$

(2)

where *A* is a general differential operator, *B* is a boundary operator, $f(r)$ is a known analytical function, and Γ is the boundary of domain Ω.

The operator

*A* in (1) can be rewritten as a sum of

*L* and

*N*, where

*L* and

*N* are linear and nonlinear parts of

*A*, respectively, as follows:

By the homotopy technique, we construct the homotopy

$H(v,p)=(1-p)(L(v)-L({u}_{0}))+p(A(v)-f(r))=0,$

(3)

which is equivalent to

$H(v,p)=L(v)-L({u}_{0})+pL({u}_{0})+p(N(v)-f(r))=0,$

(4)

*p* is an embedding parameter, ${u}_{0}$ is an initial approximation of (1), which satisfies the boundary conditions. As *p* changes from zero to unity, $v(r,p)$ changes from ${u}_{0}$ to $u(r)$. In this technique, the convergence of a solution depends on the choice of ${u}_{0}$, that is, we can have different approximate solutions for different ${u}_{0}$.

Let us decompose the source function as

$f(r)={f}_{1}(r)+{f}_{2}(r)$. If we take

in (3), we obtain the following homotopy:

$H(v,p)=(1-p)(L(v)-{f}_{1}(r))+p(A(v)-f(r))=0,$

(5)

which is equivalent to

$H(v,p)=L(v)-{f}_{1}(r)+p(N(v)-{f}_{2}(r))=0.$

(6)

Obviously, from (6) we have

As the embedding parameter *p* changes from zero to unity, $v(r,p)$ changes from ${L}^{-1}({f}_{1}(r))$ to $u(r)$.

According to He’s homotopy perturbation method, we can first use the embedding parameter

*p* as a small parameter and assume that the solution of (6) can be written as a power series in

*p* as follows:

$v={v}_{0}+p{v}_{1}+{p}^{2}{v}_{2}+{p}^{3}{v}_{3}+\cdots .$

(7)

Setting

$p=1$, we get the approximate solution of (1)

$u=\underset{p\to 1}{lim}v={v}_{0}+{v}_{1}+{v}_{2}+{v}_{3}+\cdots .$

In the next section, it is shown that the decomposition of the right-hand side function has a great effect on the amount of calculation and the speed of convergence of the solution.