\documentclass[twoside]{article}
\usepackage{graphics}
\usepackage{graphicx}
\usepackage{latexsym}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{BSPMsample}
\begin{document}

\title[A new approximation method to solve boundary value problems]
{A new approximation method to solve boundary value problems by using functional perturbation concepts}
%\thanks{The project is
%partially supported by...}
%between [] goes the title that will appear on the top of every
%odd page, between {} goes the real title.
%\thanks{...} put your grant

\author[Somayeh Pourghanbar  and Mojtaba Ranjbar]{Somayeh Pourghanbar  and Mojtaba Ranjbar}
%between [] goes the authors that will appear on the top of every
%even page, between {} goes the real author.

\address{Somayeh Pourghanbar  \\Department of Mathematics, \\
Azarbaijan Shahid Madani University, \\ Iran\\
\email:s.pourghanbar@azaruniv.edu}

\address{Mojtaba Ranjbar  \\Department of Mathematics, \\
Azarbaijan Shahid Madani University, \\ Iran\\
\email:m\_ranjbar@azaruniv.edu}
\maketitle

\begin{abstract}
Functional perturbation method (FPM) is presented for the solution of differential equations with boundary conditions. Some properties of FPM are utilized to reduce the differential equation with variable coefficients to the equations with constant coefficients. The FPM can be applied directly for many types of differential equations. The exact solution is obtained by only the first term of the Frechet series for polynomial cases. Four examples are included to demonstrate the method.
\end{abstract}
%%put here Key words

\keywords Dirac operator, Frechet derivatives, Functional perturbation method.


\tableofcontents



%% put here the subject class
\2000mathclass{65L10, 34L99, 46N20}


\section{Introduction}\label{sec1}
Many real-world phenomena can be formalized in terms of differential equations. This equations should be supplied with boundary conditions to ensure that there is a unique solution. Thus boundary value problems have played a main role in the development of engineering and mathematics. They have many applications in fields such as mechanics \cite{Altus Microstress estimate}, optimal control \cite{optimal control1}, geometric optics \cite{Geometric optics1}, oceanography \cite{oceanography1}, finance mathematics \cite{Barles1998} etc. There are mainly three types of approaches for solving differential equations. One approach is solving equations by analytical techniques. The other approach is designing numerical algorithms to solve equations. For example step difference schemes \cite{step difference in this j}, collocation method \cite{collocaton method in this j, Legendre collocation Jun, Mohammadzadeh Lakestani} and tau method \cite{Tau method in this j} are of this types. The third class of methods is based on semi analytical approaches like Adomian decomposition method \cite{Adomian in this j}, variational iteration method \cite{DehghanPourghanbar}, homotopy perturbation method \cite{homotopy in this j}, etc.
 But this paper proposes the functional perturbation method (FPM) which the main idea behind that is to use Frechet series. This idea is successfully and effectively applied in some papers.
In 2003, the buckling load in equation is treated as a functional of the bending modulus field by  Altus and et al. \cite{Altus Buckling of stochastically}. They have applied a functional perturbation to equation, therefore the buckling load was found analytically to any desired degree of accuracy.
 In the same year the FPM has been used for calculating the average deflections and reaction forces of stochastically heterogeneous beams in \cite{Altus Analysis of Bernoulli beams}.
 In 2006, a one dimensional stochastically heterogeneous rod embedded in a uniform shear resistant elastic medium is solved in \cite{Altus Microstress estimate}.
  The solution of natural frequencies and mode shapes of non-homogeneous rods and beams was studied based on the FPM in 2007  \cite{Altus Natural frequencies}. Also in the same year the buckling load of heterogeneous columns has been found by applying the FPM directly to the buckling differential equation in \cite{Altus Buckling of non-uniform}.
  The FPM is generalized in \cite{Altus A novel application of} for solving eigenvalue functional differential equations in 2008.  In the current study, we use the FPM to approximate the solution of linear and nonlinear ordinary differential equations. Despite some methods like Galerkin and Rayleigh-Ritz, the accuracy of the FPM dose not depend on the arbitrarily chosen shape functions.
The solution for each problem is
founded by only convoluting its functional derivatives.
   We expand the equations functionally, yielding some ordinary differential equations which have constant coefficients.
   \newline
    In a concise manner, our first aim is to find an approximate solution of the equation by considering $E_0=\langle E \rangle$ as an average of function $E$. It is worth pointing out that finding the best choice of $E_0$ is an important subject of optimization which is under investigation. Our second aim is to improve the approximate solution obtained in the previous step by using properties of Dirac function and functional derivative rules.
    \newline
       Four examples are given to show the efficiency of the method. To the best of our knowledge this is the first time that the FPM is proposed to solve a nonlinear differential equation.
        \newline
        The remaining of this paper is organized as follows. Section 2 is outlined some necessary preliminaries.
 The FPM and theoretical aspects of the method are elaborated in Section 3.
 In Section 4, we employ FPM for four examples. Finally, major conclusions are drown in Section 5.

\section{Preliminaries}\label{sec2}
First we introduce some mathematical definitions that will
be used in the sequel. Derivatives of a function $u(x)\equiv u$ will be written as:
\begin{equation*}
\frac{du}{dx}\equiv u_{,x} \quad , \quad \frac{d^2u}{dx^2}\equiv u_{,xx} \quad ,\ldots

\end{equation*}
 Let $E$ is a scalar function of $x$ and $u[E]$ is a functional of $E$, i.e., a mapping from a normed linear space of functions (a Banach space) $M=\{E(x): x\in \mathbb{R}\}$ to the field of real or complex numbers, $u:M\rightarrow\mathbb{R}$ or $\mathbb{C}$. The $\frac{\delta u[E(x)]}{\delta E(x_1)}$ tells how the value of the functional changes if the function $E(x)$ is changed at the point $x_1$. Thus the functional derivative (Frechet derivative) itself is an ordinary function depending on $x_1$.
  First order and higher orders Frechet derivatives of the functional will be written as:
 \begin{equation*}
 \frac{\delta u}{\delta E(x_1)}\equiv u_{,E_1} \quad , \quad \frac{\delta^2 u}{\delta E(x_1)\delta E(x_2)}\equiv u_{,E_1E_2} \quad ,\ldots

 \end{equation*}
 We consider a measure space $(\mathbb{R}^d,\Omega,\nu)$, where $\nu$ is a Borel measure, $d$ is a positive integer. Also $u: L^p(\nu)\rightarrow\mathbb{R}$ be a real functional over the normed space $L^p(\nu)$ such that $u$ maps functions that are $L^p$ integrable with respect to $\nu$ to the real line. The bounded linear functional $u_{,E_1}$ is the Fr�echet derivative of $u$ at $\langle E\rangle \in L^p(\nu)$
if
\begin{equation*}
u[\langle E\rangle+E']-u[\langle E\rangle]=u_{,E_1}+\epsilon[\langle E\rangle,E']\|E'\|_{L^p(\nu)}
\end{equation*}
for all $E'\in L^p(\nu)$, with $\epsilon[\langle E\rangle,E']\rightarrow 0$ as $\|E'\|_{L^p(\nu)}\rightarrow 0$. Intuitively, what we are doing is perturbing the input function
 $\langle E\rangle$ by another function $E'$, then shrinking the perturbing function $E'$ to zero in terms or its $L^p$ norm, and considering the
difference $u[\langle E\rangle+E']-u[\langle E\rangle]$ in this limit. For the second variation $u_{,E_1E_2}$, we have
\begin{equation*}
u[\langle E\rangle+E']-u[\langle E\rangle]=u_{,E_1}+\frac{1}{2}u_{,E_1E_2}+\epsilon[\langle E\rangle,E']\|E'\|_{L^p(\nu)}
\end{equation*}
where $\epsilon[\langle E\rangle,E']\rightarrow 0$ as $\|E'\|_{L^p(\nu)}\rightarrow 0$ \cite{An Introduction Washington}.
 According to \cite{Beran Statistical continuum mechanics}, the functional derivative is represented as the limit of divided differences:
 \begin{equation}\label{definition of derivative}
 u_{,E_1}=\lim_{\epsilon\rightarrow 0}\frac{u[E(x)+\epsilon\delta(x-x_1)]-u[E(x)]}{\epsilon}.
 \end{equation}
 The $x$ dependence on the right hand side of (\ref{definition of derivative}) is only a formal one. It can be written $\epsilon(\cdot-x_1)$ with the notation $E(\cdot)$ instead of $E(x)$.
 The Dirac function $\delta$ in (\ref{definition of derivative}) is \cite{Beran Statistical continuum mechanics}:
 \begin{equation}\label{Dirac}
\delta(x-x_1)\equiv \delta_{xx_1}= \left\{
\begin{array}{rl}
1 & \text{if } x=x_1\\
0 & \text{if } x\neq x_1
\end{array} \right.
\end{equation}
 %\begin{equation}\label{Dirac}
%\delta(x-x_1)\equiv \delta_{xx_1}=1 \quad x=x_1.
%\end{equation}
As a matter of fact, by considering $u[E]=E(x)$, we have:
 \begin{equation*}\label{}
u_{,E_1}=\frac{\delta u[E]}{\delta E(x_1)}=\lim_{\epsilon\rightarrow 0}\frac{1}{\epsilon} \big(E(x)+\epsilon\delta(x-x_1)-E(x)\big)=\delta(x-x_1)=\delta_{xx_1}= E_{,E_1}.
\end{equation*}
Therefore we can denote the derivative of Dirac function as:
\begin{equation*}\label{Dirac derivative}
\big(\frac{\delta E(x)}{\delta E(x_1)}\big)_{,x}=\delta_{xx_1,x}.
\end{equation*}
The average $\langle E\rangle$ and the deviation function $E'(x)$ of function $E$ are defined as \cite{Altus A new functional}:
\begin{equation}\label{average in some sense}
\langle E\rangle=\int_0^1 E(x)dx=E\ast 1,
\end{equation}
\begin{equation}\label{deviation function}
E'(x)=E(x)-\langle E\rangle.
\end{equation}
In (\ref{average in some sense}), sign $(\ast)$ is convolution and $1$ is a unit function.
 The property of the  Dirac function which we need them in FPM frequently is \cite{Kanwal Generalized functions},:
\begin{equation}\label{main property}
\delta\ast E=E,
\end{equation}
because:
\begin{equation}\label{integral concept for main property}
\delta\ast E=\int\delta(x_1-x_2)E(x_2)dx_2=E(x_1).
\end{equation}
It is worthwhile to know where $E(x_2)$ is a sufficiently smooth function, (\ref{integral concept for main property}) is called the sifting property or reproducing property of the Dirac function \cite{Kanwal Generalized functions}.\\
 For multiple convolutions we have:
%\begin{equation*}\label{multiple convolutions double integration}
%\begin{array}{c}
%  u_{,E_1E_2}\ast\ast E_1E_2 =E_1\ast u_{,E_1E_2}\ast E_2=E(x_1)\ast \frac{\delta^2 u}{\delta E(x_1)\delta E(x_2)}\ast E(x_2) \\
%  \\
%  = \int\int\frac{\delta}{\delta E(x_2)}(\frac{\delta u}{\delta E(x_1)}) E(x_1)E(x_2)dx_1dx_2.
%\end{array}
%\end{equation*}
\begin{equation*}\label{multiple convolutions double integration}
  u_{,E_1E_2}\ast\ast E_1E_2 =\int\int\frac{\delta}{\delta E(x_2)}(\frac{\delta u}{\delta E(x_1)}) E(x_1)E(x_2)dx_1dx_2,
\end{equation*}
and since $u_{,E_1E_2}$ is symmetric, we can write also \cite{Altus Buckling of stochastically}:
\begin{equation*}
u_{,E_1E_2}\ast\ast E_1 E_2= E_1\ast u_{,E_1E_2}\ast  E_2= E_1\ast \frac{\delta^2 u}{\delta E(x_1)\delta E(x_2)}\ast E_2.
\end{equation*}
Besides, the indispensable relation between the derivative of Dirac function $\delta$ and convolution is:
\begin{equation}\label{relation rond delta convolution}
\frac{\partial \delta}{\partial x_i}\ast E=\delta \ast \frac{\partial E}{\partial x_i}=\frac{\partial E}{\partial x_i}.
\end{equation}
(\ref{relation rond delta convolution}) can be extended to the differential operator $L$ of each order:
\begin{equation}\label{differential operator order p}
(L\delta)\ast E=\delta \ast L(E)=L(E).
\end{equation}
We refer the interested reader to \cite{Beran Statistical continuum mechanics,Kanwal Generalized functions} for more discussion.
The Frechet expansion \cite{Altus Buckling of stochastically, Altus Natural frequencies, Altus Buckling of non-uniform, Altus A novel application of} of a function $f$ around $\langle E\rangle$ is as:
\begin{eqnarray}\label{frechet of u}
f &=& f(\langle E\rangle)+f_{,E_1} \big |_{E=\langle E\rangle}\ast E_1'+\frac{1}{2!}f_{,E_1E_2} \big |_{E=\langle E\rangle}\ast \ast E_1'E_2'+\cdots \nonumber\\
&=& f^{(0)}+f^{(1)}+\frac{1}{2!}f^{(2)}+\cdots
\end{eqnarray}
%
%The following questions have to be addressed for (\ref{frechet of u}) to be meaningful:
% \begin{enumerate}
% \item Do the Frechet derivatives exist?
% \item What are the conditions $E'$ for the series expansion in the right hand side of (\ref{frechet of u}) to convergence to the left hand side of (\ref{frechet of u})?
% \item What is the approximation error between the finite series approximation of the right hand side of (\ref{frechet of u}) to the left hand side of (\ref{frechet of u})?
% \end{enumerate}
%To answer these questions,
\\
Expansion (\ref{frechet of u}) is exact for a polynomial $P(x)=a_nx^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0$. As a matter of fact, by considering $E(x)=x^n$, (\ref{average in some sense}) and (\ref{deviation function}) we have:
\begin{equation*}
\langle E\rangle=\frac{1}{n+1}, \quad E'=x^n-\frac{1}{n+1}.
\end{equation*}
We rewrite $P(x)$ as:
\begin{equation*}
P(x)=a_nE+\frac{a_{n-1}}{n}E_{,x}+\frac{a_{n-2}}{n(n-1)}E_{,xx}+\cdots+\frac{a_1}{n(n-1)\cdots\times2}E_{,x^{n-1}}+\frac{a_0}{n!}E_{,x^{n}}
\end{equation*}
Now, for the first term of the Frechet expansion of $P$, we have:
\begin{equation}
P^{(0)}\equiv P\big |_{E=\langle E\rangle}=a_n\langle E\rangle=\frac{a_n}{n+1}.
\end{equation}
Also for the second term of the expansion of $P$:
%by (\ref{frechet of u}) we have:
\begin{eqnarray}
% \nonumber to remove numbering (before each equation)
  P^{(1)} &\equiv& P_{,E_1} \big |_{E=\langle E\rangle}\ast E_1'=(a_n E_{,E_1}+\frac{a_{n-1}}{n}E_{,xE_1}+\cdots+\frac{a_0}{n!}E_{,x^nE_1})\big |_{E=\langle E\rangle}\ast E_1' \nonumber\\
  &=& (a_n \delta+\frac{a_{n-1}}{n}\delta_{,x}+\cdots+\frac{a_0}{n!}\delta_{,x^n})\ast E_1' \nonumber\\
  &=& a_n E_1'+\frac{a_{n-1}}{n}(E_1')_{,x}+\frac{a_{n-2}}{n(n-1)}(E_1')_{,xx}+\cdots+\frac{a_0}{n!}(E_1')_{,x^n} \nonumber\\
  &=& a_n(x^n-\frac{1}{n+1})+\frac{a_{n-1}}{n}(nx^{n-1})+\frac{a_{n-2}}{n(n-1)}(n(n-1)x^{n-2})+\cdots+\frac{a_0}{n!}(n!) \nonumber\\
   &=& a_nx^n-\frac{a_n}{n+1}+a_{n-1}x^{n-1}+a_{n-2}x^{n-2}+\cdots+a_1x+a_0,
\end{eqnarray}
and because of $E_{,E_1E_2}=0, \quad E_{,E_1E_2E_3}=0,\cdots $, etc:
\begin{equation*}
P^{(2)}\equiv P_{,E_1E_2} \big |_{E=\langle E\rangle}\ast \ast E_1'E_2'=0, \quad P^{(3)}=0, \quad ...\quad etc.
\end{equation*}
Therefore
\begin{equation*}
P=P^{(0)}+P^{(1)}+\frac{1}{2!}P^{(2)}+\cdots=a_nx^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0.
\end{equation*}
This shows that the Frechet expansion is exact for polynomials.




\section{Functional Perturbation Method}\label{sec3}
In this section, we demonstrate the theoretical aspects of the FPM. For this purpose let us consider the differential operator:
\begin{equation}\label{e}
    \mathcal{L}u(x)= f(x),\quad x\in [0,1],
\end{equation}
$\mathcal{L}$ is a general linear differential operator with boundary operator:
\begin{equation}\label{e5}
    \mathcal{B}u(x_i)=u_i.
\end{equation}
 The Frechet expansion of the unknown function $u(x)$ is:
 \begin{equation}\label{Frechet u}
u(E(x))=u\big |_{E=\langle E\rangle}+u_{,E_1} \big |_{E=\langle E\rangle}\ast E_1'+\frac{1}{2!}u_{,E_1E_2} \big |_{E=\langle E\rangle}\ast \ast E_1'E_2'+\cdots
\end{equation}
We denote:
\begin{equation*}\label{naamgozari jomalate u}
u(\langle E\rangle)\equiv u^{(0)} \quad , \quad u_{,E_1}\big |_{E=\langle E\rangle}\ast E_1'\equiv u^{(1)} \quad , \quad u_{,E_1E_2}\big |_{E=\langle E\rangle}\ast \ast E_1'E_2'\equiv u^{(2)}\quad , \quad \cdots
\end{equation*}
Therefore (\ref{Frechet u}) can be written as $u=u^{(0)}+u^{(1)}+\frac{1}{2!}u^{(2)}+\cdots$.
%\begin{equation*}\label{frechet u}
%u=u^{(0)}+u^{(1)}+\frac{1}{2!}u^{(2)}+\cdots
%\end{equation*}
 Let us assume that Eq. (\ref{e}) can be expressed as:
\begin{equation}\label{e6}
\mathcal{L} u=\phi_{(0)}(E)u+\phi_{(1)}(E)u_{,x}+\phi_{(2)}(E)u_{,xx}+\cdots=f(x).
\end{equation}
For functions $\phi_{(i)},i=0,1,\cdots$, the Frechet expansion around $\langle E\rangle$ is:
\begin{equation}\label{Frechet phi}
\phi_{(i)}=\phi_{(i)}(\langle E\rangle)+\phi_{(i),E_1}\ast E_1'+\frac{1}{2!}\phi_{(i),E_1E_2}\ast \ast E_1'E_2'+\cdots,
\end{equation}
by considering
\begin{equation}\label{naamgozari jomalate phi}
\phi_{(i)}(\langle E\rangle)\equiv \phi_{(i)}^{(0)}\quad ,  \quad \phi_{(i),E_1}\ast E_1'\equiv \phi_{(i)}^{(1)} \quad , \quad \phi_{(i),E_1E_2}\ast \ast E_1'E_2'\equiv \phi_{(i)}^{(2)}\quad , \quad etc.
\end{equation}
(\ref{Frechet phi}) will be written as $\phi_{(i)}=\phi_{(i)}^{(0)}+\phi_{(i)}^{(1)}+\frac{1}{2!}\phi_{(i)}^{(2)}+\cdots$.
%\begin{equation}\label{frechet phi}
%\phi_{(i)}=\phi_{(i)}^{(0)}+\phi_{(i)}^{(1)}+\frac{1}{2!}\phi_{(i)}^{(2)}+\cdots
%\end{equation}
Now, by using the Frechet expansion for the differential operator $L$, we will have:
\begin{equation}\label{Frechet L}
\mathcal{L}u=\mathcal{L}u(\langle E\rangle)+\mathcal{L}(u)_{,E_1}\big |_{E=\langle E\rangle}\ast E_1'+\frac{1}{2}\mathcal{L}(u)_{,E_1E_2}\big |_{E=\langle E\rangle} \ast \ast E_1'E_2'+\cdots=f(x).
\end{equation}
As the first step, by the special case $E=\langle E\rangle$, we suppose:
\begin{equation*}\label{First}
 \mathcal{L}u(\langle E\rangle)=f(x).
  \end{equation*}
%so by (\ref{Frechet L}) and (\ref{First}):
Therefore we should have:
\begin{equation}\label{LE1=0  LE2=0}
\mathcal{L}(u)_{,E_1}\big |_{E=\langle E\rangle}\ast E_1'=0 \quad , \quad \mathcal{L}(u)_{,E_1E_2}\big |_{E=\langle E\rangle} \ast \ast E_1'E_2'=0 \quad ,\quad etc.
 \end{equation}
 For the product of two functionals, the ordinary product rule applies:
\begin{equation}\label{derivative E1}
\mathcal{L}u_{,E_1}=\phi_{(0),E_1}u+\phi_{(0)}u_{,E_1}+\phi_{(1),E_1}u_{,x}+\phi_{(1)}u_{,xE_1}+\phi_{(2),E_1}u_{,xx}+\phi_{(2)}u_{,xxE_1}+\cdots
\end{equation}
For brevity, we denote (\ref{derivative E1}) as:
\begin{equation}\label{equivalent derivative E1}
\mathcal{L}u_{,E_1}=\phi_{(i),E_1}.u_{,x^i}+\phi_{(i)}.u_{,x^iE_1} \quad i=0,1,\cdots
\end{equation}
which $(\cdot)$ is inner product. Now when we use $E=\langle E\rangle$, Eq. (\ref{e6}) can be shown as:
 \begin{equation}\label{reduced form}
\phi_{(0)}^{(0)}u^{(0)}+\phi_{(1)}^{(0)}u_{,x}^{(0)}+\phi_{(2)}^{(0)}u_{,xx}^{(0)}+\cdots=f(x),
\end{equation}
 $u^{(0)}$ will be known from solving Eq. (\ref{reduced form}) subject to (\ref{e5}).
 By using (\ref{equivalent derivative E1}) for $\langle E\rangle$ and inner integral product (convolution) $E_1'$ and then considering the first equality in (\ref{LE1=0  LE2=0}) we have:
\begin{equation}\label{L1}
\mathcal{L}u_{,E_1}|_{\langle E\rangle}\ast E_1'=\phi_{(i),E_1}.u_{,x^i}\big |_{E=\langle E\rangle}\ast E_1'+\phi_{(i)}.u_{,x^iE_1} \big |_{E=\langle E\rangle}\ast E_1'=\phi_{(i)}^{(1)}.u_{,x^i}^{(0)}+\phi_{(i)}^{(0)}.u_{,x^i}^{(1)}=0,
\end{equation}
Inasmuch as $u^{(0)}$ is known from the solving of Eq. (\ref{reduced form}), we obtain $u^{(1)}$ by solving (\ref{L1}) subject to homogeneous boundary conditions. Also from (\ref{equivalent derivative E1}) and the product rule for functionals, we will have:
\begin{equation}\label{LE1 E2}
 \mathcal{L}u_{,E_1E_2}=\phi_{(i),E_1E_2}.u_{,x^i}+\phi_{(i),E_1}.u_{,x^iE_2}+\phi_{(i),E_2}.u_{,x^iE_1}+\phi_{(i)}.u_{,x^iE_1E_2}.
 \end{equation}
 Applying multiple convolution  on (\ref{LE1 E2}):
   \begin{align}\label{long formula}
 \mathcal{L}u_{,E_1E_2}\ast \ast E_1'E_2'&=\phi_{(i),E_1E_2}.u_{,x^i}\ast \ast E_1'E_2'+\phi_{(i),E_1}.u_{,x^iE_2}\ast \ast E_1'E_2' \nonumber\\
 &+\phi_{(i),E_2}.u_{,x^iE_1}\ast \ast E_1'E_2'+\phi_{(i)}.u_{,x^iE_1E_2}\ast \ast E_1'E_2' \nonumber\\
 &=\phi_{(i),E_1E_2}.u_{,x^i}\ast \ast E_1'E_2'+\phi_{(i),E_1}\ast E_1'.u_{,x^iE_2}\ast E_2' \nonumber\\
 &+\phi_{(i),E_2}\ast E_2'.u_{,x^iE_1}\ast E_1'+\phi_{(i)}.u_{,x^iE_1E_2}\ast \ast E_1'E_2' \nonumber\\
 &=0.\
 \end{align}
%Also we have:
% \begin{equation}\label{equiv phi1 and u1}
% \phi_{(i)}^{(1)}= \phi_{(i),E_1}\ast E_1'=\phi_{(i),E_2}\ast E_2', \quad u_{,x^i}^{(1)}= u_{,x^iE_1}\ast E_1'=u_{,x^iE_2}\ast E_2',
%\end{equation}
Also
\begin{equation}\label{equiv phi2 and u2}
\phi_{(i)}^{(2)}\equiv \phi_{(i),E_1E_2}\ast \ast E_1'E_2', \quad u_{,x^i}^{(2)}\equiv u_{,x^iE_1E_2}\ast \ast E_1'E_2'.
\end{equation}
By using (\ref{equiv phi2 and u2}), we can rewrite Eq. (\ref{long formula}) as:
\begin{equation}\label{saadeh shodeye long formula}
\phi_{(i)}^{(2)}.u_{,x^i}^{(0)}+2\phi_{(i)}^{(1)}.u_{,x^i}^{(1)}+\phi_{(i)}^{(0)}.u_{,x^i}^{(2)}=0.
\end{equation}
 We ponder homogeneous boundary conditions for obtaining $u^{(2)}$ by solving Eq. (\ref{saadeh shodeye long formula}).
 The solution of the Eq. (\ref{e}) is:
  \begin{equation*}\label{FPM solution}
  u=u^{(0)}+u^{(1)}+\frac{1}{2}u^{(2)}+\cdots
  \end{equation*}
  which $u^{(i)}$, $i=0,1,2,\cdots$ are obtained from solving respectively (\ref{reduced form}), (\ref{L1}), (\ref{saadeh shodeye long formula}), etc.



\section{Examples}\label{sec4}
In this section, we apply the above method for some examples. The first one has a polynomial solution and the FPM is exact for it by only one term of the expansion. Two other examples are linear ODEs and the last one is a nonlinear case which FPM solutions are compared with the exact solutions of them.
We measure the accuracy by considering the root mean square error (RMSE) as follow:
\begin{equation*}\label{RMSE}
RMSE=\frac{1}{n}\sqrt{\sum_{i=1}^{n}e_i^2},
\end{equation*}
where $n$ is the number of interior nodes and $e_i$ is the error. If $i$, $u_{exact}(x_i)=0$;  we use absolute error $e_i=u_{exact}(x_i)-u_{FPM}(x_i)$, otherwise we use relative error $e_i=\frac{u_{exact}(x_i)-u_{FPM}(x_i)}{u_{exact}(x_i)}$.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Example Polynomial:
\subsection{Example 1}
\quad As the first example, we consider
\begin{equation}\label{polynomial example}
u+(x-1)u_{,x}-\frac{3}{2}x^2u_{,xx}=-1,
\end{equation}
with $u(0)=0$ and $u_{,x}(0)=1$. The exact solution of this problem is $u(x)=x^2+x$. By $E(x)=x^2$ and considering Eq. (\ref{polynomial example}) as Eq. (\ref{e6}), we have:
\begin{equation}\label{phi Poly}
\phi_{(0)}(E)=1=\frac{1}{2}E_{,xx} \quad \phi_{(1)}(E)=x-1=\frac{1}{2}E_{,x}-\frac{1}{2}E_{,xx}, \quad \phi_{(2)}(E)=-\frac{3}{2}x^2=-\frac{3}{2}E.
\end{equation}
 Also
 \begin{equation}\label{<E> Poly}
 \langle E\rangle=\int_0^1 x^2dx=\frac{1}{3}, \quad E'=E-\langle E\rangle=x^2-\frac{1}{3}.
 \end{equation}
 As the first step, by (\ref{phi Poly}) and (\ref{<E> Poly}) we have:
 \begin{equation}\label{phi for first step Ex polynomial}
\phi_{(0)}^{(0)}=\phi_{(0)}\big |_{E=\langle E\rangle}=\frac{1}{2}(\langle E\rangle)_{,xx}=0,\quad \phi_{(1)}^{(0)}=\frac{1}{2}(\langle E\rangle)_{,x}-\frac{1}{2}(\langle E\rangle)_{,xx}=0,\quad \phi_{(2)}^{(0)}=-\frac{3}{2}\langle E\rangle=-\frac{1}{2}.
\end{equation}
In this step, the equation $\phi_{(0)}u+\phi_{(1)}u_{,x}+\phi_{(2)}u_{,xx}=-1,$ is as:
\begin{equation*}
\phi_{(0)}^{(0)}u^{(0)}+\phi_{(1)}^{(0)}u_{,x}^{(0)}+\phi_{(2)}^{(0)}u_{,xx}^{(0)}=-1
\end{equation*}
therefore by (\ref{phi for first step Ex polynomial}) we have:
%by (\ref{phi for first step Ex polynomial}):
 \begin{equation}\label{u0 eq Ex polynomial}
 -\frac{1}{2}u_{,xx}^{(0)}=-1.

 \end{equation}
Solving Eq. (\ref{u0 eq Ex polynomial}) with conditions $u^{(0)}(0)=0$ and $u_{,x}^{(0)}(0)=1$, we have
\begin{equation*}\label{u0 Ex polynomial}
 u^{(0)}=x^2+x.
 \end{equation*}
For the next step:
\begin{equation*}\label{ phi for second step Ex polynomial}
 \phi_{(0)}^{(1)}=\phi_{(0),E_1}\ast E_1'=\frac{1}{2}E_{,xxE_1}\ast E_1'=\frac{1}{2}\delta_{,xx}\ast E_1'=\frac{1}{2}(E_1')_{,xx}=\frac{1}{2}(x^2-\frac{1}{3})=1,
 \end{equation*}
and
 \begin{equation*}
 \phi_{(1)}^{(1)}=\phi_{(1),E_1}\ast E_1'=(\frac{1}{2}E_{,xE_1}-\frac{1}{2}E_{,xxE_1})\ast E_1'=\frac{1}{2}\delta_{,x}\ast E_1'-\frac{1}{2}\delta_{,xx}\ast E_1'=\frac{1}{2}(E_1')_{,x}-\frac{1}{2}(E_1')_{,xx}=x-1,
 \end{equation*}
and
\begin{equation*}
\phi_{(2)}^{(1)}=\phi_{(2),E_1}\ast E_1'=(-\frac{3}{2}E)_{,E_1}\ast E_1'=-\frac{3}{2}\delta\ast E_1'=-\frac{3}{2}E_{1}'=-\frac{3}{2}(x^2-\frac{1}{3})=-\frac{3}{2}x^2+\frac{1}{2}.
\end{equation*}
 So by the last equality of Eq. (\ref{L1}) we have:
 \begin{equation*}\label{}
u^{(0)}+(x-1)u_{,x}^{(0)}+(-\frac{3}{2}x^2+\frac{1}{2})u_{,xx}^{(0)}-\frac{1}{2}u_{,xx}^{(1)}=0,
\end{equation*}
therefore
 \begin{equation}\label{u1 eq Ex polynomial}
-\frac{1}{2}u_{,xx}^{(1)}=0.

\end{equation}
Eq. (\ref{u1 eq Ex polynomial}) differs from Eq. (\ref{u0 eq Ex polynomial}) of step.$1$ by the right hand side part only.
We solve Eq. (\ref{u1 eq Ex polynomial}) by homogeneous conditions $u^{(1)}(0)=0$ and $u_{,x}^{(1)}(0)=0$, then
\begin{equation*}\label{u1 Ex polynomial}
 u^{(1)}=0.
 \end{equation*}
For the next steps $u^{(j)}=0, \quad j=2,3,\cdots$.
Therefore the FPM solution is
 \begin{equation*}\label{solution Ex polynomial}
 u_{FPM}=u^{(0)}+u^{(1)}+\frac{1}{2!}u^{(2)}=x^2+x.
 \end{equation*}
It is observed that the FPM gives the exact solution only by the first term of Frechet series.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Example 2}
\quad Consider
\begin{equation}\label{second example}
-xu_{,x}+(1-x^2)u_{,xx}=0,

\end{equation}
with $u(0)=0$ and $u_{,x}(0)=1$. Considering $(\ref{second example})$ as $\phi_{(1)}u_{,x}+\phi_{(2)}u_{,xx}=0$ and $E(x)=1-x^2$, we have
\begin{equation*}
\phi_{(1)}=-x=\frac{1}{2}E_{,x}, \quad \phi_{(2)}=1-x^2=E,
\end{equation*}
Also
\begin{equation*}
 \langle E\rangle=\int_0^1 (1-x^2)dx=\frac{2}{3}, \quad E'=E-\langle E\rangle=\frac{1}{3}-x^2,
 \end{equation*}
  and
 \begin{equation}\label{phi for first step Ex2}
\phi_{(1)}^{(0)}=\phi_{(1)}\big |_{E=\langle E\rangle}=\frac{1}{2}(\langle E\rangle)_{,x}=0, \quad \phi_{(2)}^{(0)}=\phi_{(2)}\big |_{E=\langle E\rangle}=\langle E\rangle=\frac{2}{3}.
\end{equation}
In the first step which we use $E=\langle E\rangle$, Eq. (\ref{second example}) is
\begin{equation*}
\phi_{(1)}^{(0)}u_{,x}^{(0)}+\phi_{(2)}^{(0)}u_{,xx}^{(0)}=0,
\end{equation*}
therefore by (\ref{phi for first step Ex2}) we have:
 \begin{equation}\label{u0 eq Ex2}
 \frac{2}{3}u_{,xx}^{(0)}=0.
 \end{equation}
Applying conditions $u^{(0)}(0)=0$ and $u_{,x}^{(0)}(0)=1$, yields:
\begin{equation}\label{u0 Ex2}
 u^{(0)}=x.
 \end{equation}
For the next step:
 \begin{equation*}\label{ phi for second step Ex2}
 \phi_{(1)}^{(1)}=\phi_{(1),E_1}\ast E_1'=\frac{1}{2}E_{,xE_1}\ast E_1'=\frac{1}{2}\delta_{,x}\ast E_1'=\frac{1}{2}(E_1')_{,x}=\frac{1}{2}(\frac{1}{3}-x^2)_{,x}=-x,
 \end{equation*}
and
\begin{equation*}
\phi_{(2)}^{(1)}=\phi_{(2),E_1}\ast E_1'=E_{,E_1}\ast E_1'=\delta\ast E_1'=E_{1}'=\frac{1}{3}-x^2,
\end{equation*}
 so by the last equality of (\ref{L1}) we have:
 \begin{equation}\label{AB}
\frac{2}{3}u_{,xx}^{(1)}-xu_{,x}^{(0)}+(\frac{1}{3}-x^2)u_{,xx}^{(0)}=0,
\end{equation}
therefore by substituting (\ref{phi for first step Ex2}) and derivatives of (\ref{u0 Ex2}) in the (\ref{AB}):
 \begin{equation}\label{u1 eq Ex2}
\frac{2}{3}u_{,xx}^{(1)}=x.
\end{equation}
We solve Eq. (\ref{u1 eq Ex2}) subject to homogeneous conditions $u^{(1)}(0)=0$ and $u_{,x}^{(1)}(0)=0$:
\begin{equation*}\label{u1 Ex2}
 u^{(1)}=\frac{1}{4}x^3.
 \end{equation*}
Inasmuch as $\phi_{(1)}^{(2)}=0$ and $\phi_{(2)}^{(2)}=0$, and according to (\ref{saadeh shodeye long formula}):
\begin{equation}\label{u2 eq Ex2}
\frac{2}{3}u_{,xx}^{(2)}=\frac{9}{2}x^3-x.
 \end{equation}
As we see, Eq. (\ref{u2 eq Ex2}) differs from Eq. (\ref{u0 eq Ex2}) and Eq. (\ref{u1 eq Ex2}) by the right hand side only.
Solving Eq. (\ref{u2 eq Ex2}) with $u^{(2)}(0)=0$ and $u_{,x}^{(2)}(0)=0$, leads to:
\begin{equation*}\label{u2 Ex2}
 u^{(2)}=\frac{27}{80}x^5-\frac{1}{4}x^3.
 \end{equation*}
Therefore the FPM solution is
 \begin{equation*}\label{solution Ex2}
 u_{FPM}=u^{(0)}+u^{(1)}+\frac{1}{2!}u^{(2)}=x+\frac{1}{4}x^3+\frac{1}{2!}(\frac{27}{80}x^5-\frac{1}{4}x^3)=x+\frac{1}{8}x^3+\frac{27}{160}x^5.
 \end{equation*}
We have showed FPM solution, exact solution ($u(x)=\arcsin x$) and absolute error in
Table 1. The graph of exact and FPM solution is depicted in Fig. 1.
\begin{figure}
\centering
\includegraphics[angle=0,
width=0.5\textwidth]{Pourghanbar2.eps}
\caption{Exact and FPM solutions (Example 2).}
\end{figure}
%%%%%%
\begin{table}[h]\caption{Absolute error of Example 2 }\label{tab1}
\centering
\begin{tabular}{|lllll|}
 \hline
 &\footnotesize{ $x_i$}&\footnotesize{~~~FPM}
&\footnotesize{~~~~Exact}&\footnotesize{~~~~Absolute error}\\
\hline
&\footnotesize{$0$}&\footnotesize{~~~$0$}&\footnotesize{~~~~$0$}&\footnotesize{~~~~$0$}\\
 &\footnotesize{$0.1$}&\footnotesize{~~~$0.1001$}&\footnotesize{~~~~$0.1002$}&\footnotesize{~~~~$1.0E-04$}\\
 &\footnotesize{$0.2$}&\footnotesize{~~~$0.2011$}&\footnotesize{~~~~$0.2014$}&\footnotesize{~~~~$3.0E-04$}\\
 &\footnotesize{$0.3$}&\footnotesize{~~~$0.3038$}&\footnotesize{~~~~$0.3047$}&\footnotesize{~~~~$9.0E-04$}\\
 &\footnotesize{$0.4$}&\footnotesize{~~~$0.4097$}&\footnotesize{~~~~$0.4115$}&\footnotesize{~~~~$1.8E-03
$}\\
 &\footnotesize{$0.5$}&\footnotesize{~~~$0.5209$}&\footnotesize{~~~~$0.5236$}&\footnotesize{~~~~$2.7E-03$}\\
 &\footnotesize{$0.6$}&\footnotesize{~~~$0.6401$}&\footnotesize{~~~~$0.6435$}&\footnotesize{~~~~$3.4E-03$}\\
 &\footnotesize{$0.7$}&\footnotesize{~~~$0.7712$}&\footnotesize{~~~~$0.7754$}&\footnotesize{~~~~$4.2E-03$}\\
 &\footnotesize{$0.8$}&\footnotesize{~~~$0.9193$}&\footnotesize{~~~~$0.9273$}&\footnotesize{~~~~$8.0E-03$}\\
 &\footnotesize{$0.9$}&\footnotesize{~~~$1.0908$}&\footnotesize{~~~~$1.1198$}&\footnotesize{~~~~$2.9E-02$}\\
  &\footnotesize{$RMSE=3.1E-03$}&&&\\
 \hline
\end{tabular}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Example 3}
\quad As the third example, consider
 \begin{equation}\label{first equation}
 u_{,x}+(1+x)u_{,xx}=0,
 \end{equation}
  with $u(0)=0$ and $u_{,x}(1)=\frac{1}{6}$. By considering $E(x)=1+x$, we will have:
 \begin{equation*}\label{average and deviation Ex1}
 \langle E\rangle=\int_0^1 (1+x)dx=\frac{3}{2}, \quad E'(x)=E(x)-\langle E\rangle=x-\frac{1}{2}.
 \end{equation*}
 Comparing $(\ref{first equation})$ with $\phi_{(1)}u_{,x}+\phi_{(2)}u_{,xx}=0$ yields $\phi_{(1)}=1=E_{,x}$ and $\phi_{(2)}=1+x=E$. We obtain $\phi_{(i)}^{(0)}$, $i=1,2$  for $E=\langle E\rangle$, as follow:
 \begin{equation}\label{ phi for first step}
 \phi_{(1)}^{(0)}=(\langle E\rangle)_{,x}=0, \quad \phi_{(2)}^{(0)}=\langle E\rangle=\frac{3}{2}.
 \end{equation}
 For the first step, (\ref{first equation}) is:
 \begin{equation*}\label{}
 \phi_{(1)}^{(0)}u_{,x}^{(0)}+\phi_{(2)}^{(0)}u_{,xx}^{(0)}=0,
 \end{equation*}
 by (\ref{ phi for first step}), we have:
 \begin{equation}\label{u0 eq}
 \frac{3}{2}u_{,xx}^{(0)}=0.
 \end{equation}
 Applying conditions $u(0)=0$ and $u_{,x}(1)=\frac{1}{6}$, yields:
 \begin{equation*}\label{u0}
 u^{(0)}=\frac{1}{6}x.
 \end{equation*}
 As the second step, we obtain $\phi_{(i)}^{(1)}$, $i=1,2$ as follow:
  \begin{equation*}\label{ phi for second step}
\phi_{(1)}^{(1)}=\phi_{(1),E_1}\ast E_1'=E_{,xE_1}\ast E_1'=\delta_{,x}\ast E_1'=(E_1')_{,x}=(x-\frac{1}{2})_{,x}=1,
 \end{equation*}
 \begin{equation*}
 \phi_{(2)}^{(1)}=\phi_{(2),E_1}\ast E_1'=E_{,E_1}\ast E_1'=\delta\ast E_1'=E_{1}'=x-\frac{1}{2}.
 \end{equation*}
 According to the last equality of Eq. (\ref{L1})  we have:
\begin{equation*}\label{}
\frac{3}{2}u_{,xx}^{(1)}+u_{,x}^{(0)}+(x-\frac{1}{2})u_{,xx}^{(0)}=0,
\end{equation*}
then
\begin{equation}\label{u1 eq}
 \frac{3}{2}u_{,xx}^{(1)}=-\frac{1}{6}.
 \end{equation}
 Now, we consider homogeneous conditions $u(0)=0$ and $u_{,x}(1)=0$. Therefore:
 \begin{equation*}\label{u1}
 u^{(1)}=-\frac{1}{18}x^2+\frac{1}{9}x.
 \end{equation*}
 To obtain $u^{(2)}$, from Eq. (\ref{saadeh shodeye long formula}) we have:
 \begin{equation}\label{main u2 Eq}
 \phi_{(1)}^{(2)}u_{,x}^{
 (0)}+\phi_{(2)}^{(2)}u_{,xx}^{(0)}+2\phi_{(1)}^{(1)}u_{,x}^{(1)}+2\phi_{(2)}^{(1)}u_{,xx}^{(1)}+\phi_{(1)}^{(0)}u_{,x}^{(2)}+\phi_{(2)}^{(0)}u_{,xx}^{(2)}=0.
 \end{equation}
 Apparently when $\phi_{(i)}=E_{,x^i}$, then $\phi_{(i),E_1E_2...}=0$. So
  \begin{equation*}
  \phi_{(i)}^{(2)}=\phi_{(i),E_1E_2}\ast \ast E_1'E_2'=0.
    \end{equation*}
    Therefore, from Eq. (\ref{main u2 Eq}) we have:
 \begin{equation*}\label{u2 eq Ex1}
 \frac{3}{2}u_{,xx}^{(2)}=\frac{4}{9}x-\frac{1}{3}.
 \end{equation*}
 %Eq. (\ref{u2 eq Ex1}) differs from Eq. (\ref{u1 eq}) and Eq. (\ref{u0 eq}) by the RHS only.
 With homogeneous conditions $u^{(2)}(0)=0$ and $u_{,x}^{(2)}(1)=0$, $u^{(2)}$ can be obtained:
 \begin{equation*}\label{u2}
 u^{(2)}=\frac{4}{81}x^3-\frac{1}{9}x^2+\frac{2}{27}x.
 \end{equation*}
 The solution of Eq. (\ref{first equation}) is:
 \begin{equation*}\label{solution Ex1}
 u_{FPM}=u^{(0)}+u^{(1)}+\frac{1}{2!}u^{(2)}=\frac{1}{6}x-\frac{1}{18}x^2+\frac{1}{9}x+\frac{1}{2!}(\frac{4}{81}x^3-\frac{1}{9}x^2+\frac{2}{27}x)=\frac{17}{54}x-\frac{1}{9}x^2+\frac{2}{81}x^3.
 \end{equation*}
The exact
solution ($u(x)=\frac{1}{3}\ln(1+x)$)
and the FPM solution are shown in Fig. 2. The accuracy of the solution is clearly seen by $RMSE=6.9957E-04$ with $x_i$ from Table.2.
\begin{figure}
\centering
\includegraphics[angle=0,
width=0.5\textwidth]{Pourghanbar1.eps}
\caption{Exact and FPM solutions (Example 3).}
\end{figure}
%%%%
\begin{table}[h]\caption{Absolute error of Example 3 }\label{tab2}
\centering
\begin{tabular}{|lllll|}
 \hline
 &\footnotesize{ $x_i$}&\footnotesize{~~~FPM}
&\footnotesize{~~~~Exact}&\footnotesize{~~~~Absolute error}\\
\hline
&\footnotesize{$0$}&\footnotesize{~~~$0$}&\footnotesize{~~~~$0$}&\footnotesize{~~~~$0$}\\
 &\footnotesize{$0.1$}&\footnotesize{~~~$0.0304$}&\footnotesize{~~~~$0.0318$}&\footnotesize{~~~~$1.4E-03$}\\
 &\footnotesize{$0.2$}&\footnotesize{~~~$0.0587$}&\footnotesize{~~~~$0.0608$}&\footnotesize{~~~~$2.1E-03$}\\
 &\footnotesize{$0.3$}&\footnotesize{~~~$0.0851$}&\footnotesize{~~~~$0.0875$}&\footnotesize{~~~~$ 2.3E-03$}\\
 &\footnotesize{$0.4$}&\footnotesize{~~~$0.1097$}&\footnotesize{~~~~$0.1122$}&\footnotesize{~~~~$2.4E-03
$}\\
 &\footnotesize{$0.5$}&\footnotesize{~~~$0.1327$}&\footnotesize{~~~~$0.1352$}&\footnotesize{~~~~$2.4E-03$}\\
 &\footnotesize{$0.6$}&\footnotesize{~~~$0.1542$}&\footnotesize{~~~~$0.1567$}&\footnotesize{~~~~$2.4E-03$}\\
 &\footnotesize{$0.7$}&\footnotesize{~~~$0.1744$}&\footnotesize{~~~~$0.1769$}&\footnotesize{~~~~$2.5E-03$}\\
 &\footnotesize{$0.8$}&\footnotesize{~~~$0.1934$}&\footnotesize{~~~~$0.1959$}&\footnotesize{~~~~$2.5E-03$}\\
 &\footnotesize{$0.9$}&\footnotesize{~~~$0.2113$}&\footnotesize{~~~~$0.2140$}&\footnotesize{~~~~$2.6E-03$}\\
  &\footnotesize{$RMSE=6.9957E-04$}&&&\\
 \hline
\end{tabular}
\end{table}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Example 4}
As the last example, we consider a nonlinear differential equation
\begin{equation}\label{nonlinear Ex}
uu_{,xx}-u_{,x}^2=-2,
\end{equation}
with $u(0)=1$ and $u_{,x}(0)=1$. By rewriting Eq. (\ref{nonlinear Ex}) as:
\begin{equation*}\label{rewite nonlinear Ex}
\tilde{u}u_{,xx}-\tilde{u}_{,x}u_{,x}=-2,
\end{equation*}
We can consider $\phi_{(0)}=0$, $\phi_{(1)}=-\tilde{u}_{,x}$ and $\phi_{(2)}=\tilde{u}$. First of all, we use two terms of Taylor expansion for $u(x)$:
\begin{equation*}\label{Taylor}
u(x)\simeq\tilde{u}(x)= u(0)+xu_{,x}(0)=1+x.
\end{equation*}
If we consider $E(x)=\tilde{u}=1+x$, then:
\begin{equation*}\label{}
\phi_{(1)}=-E_{,x} \quad , \quad \phi_{(2)}=E.
\end{equation*}
Also
\begin{equation*}\label{average nonlinear}
 \langle E\rangle=\int_0^1 (1+x)dx=\frac{3}{2},
 \end{equation*}
 and
 \begin{equation*}\label{deviation nonlinear}
 E'(x)=E(x)-\langle E\rangle=x-\frac{1}{2}.
  \end{equation*}
 Now, we obtain $\phi_{(i)}^{(0)}$, $i=1,2$  for $E=\langle E\rangle$ as follow:
 \begin{equation*}\label{ phi for first step nonlinear}
 \phi_{(1)}^{(0)}=-E_{,x}\big |_{E=\langle E\rangle}=0, \quad \phi_{(2)}^{(0)}=E\big |_{E=\langle E\rangle}=\frac{3}{2}.
 \end{equation*}
 In first step we have:
 \begin{equation*}\label{}
 \phi_{(1)}^{(0)}u_{,x}^{(0)}+\phi_{(2)}^{(0)}u_{,xx}^{(0)}=-2,
 \end{equation*}
 so
 \begin{equation*}\label{}
 \frac{3}{2}u_{,xx}^{(0)}=-2.
 \end{equation*}
By using $u^{(0)}(0)=1$ and $u_{,x}^{(0)}(0)=1$ we have
\begin{equation*}\label{}
 u^{(0)}=-\frac{2}{3}x^2+x+1.
 \end{equation*}
 Also $\phi_{(i)}^{(1)}$, $i=1,2$ are obtained as
  \begin{equation*}\label{ phi for second step nonlinear}
 \phi_{(1)}^{(1)}=-E_{,x}'=-1, \quad \phi_{(2)}^{(1)}=E'=x-\frac{1}{2}.
 \end{equation*}
So by Eq. (\ref{L1}) we have:
\begin{equation*}\label{}
\frac{3}{2}u_{,xx}^{(1)}=\frac{1}{3},
\end{equation*}
with homogeneous conditions $u^{(1)}(0)=0$ and $u_{,x}^{(1)}(0)=0$, $u^{(1)}$ is obtained:
\begin{equation*}\label{}
u^{(1)}=\frac{1}{9}x^2.
\end{equation*}
Inasmuch as $\phi_{(1)}^{(2)}=0$ and $\phi_{(2)}^{(2)}=0$, Eq. (\ref{saadeh shodeye long formula}) is reduced to
\begin{equation*}\label{}
\frac{3}{2}u_{,xx}^{(2)}=\frac{2}{9}.
\end{equation*}
In this step we use homogeneous conditions too, so
\begin{equation*}\label{}
u^{(2)}=\frac{2}{27}x^2.
\end{equation*}
Therefore $u_{FPM}$ is obtained
 \begin{equation*}\label{solution nonlinear}
 u_{FPM}=u^{(0)}+u^{(1)}+\frac{1}{2!}u^{(2)}=-\frac{2}{3}x^2+x+1+\frac{1}{9}x^2+\frac{1}{2!}(\frac{2}{27}x^2)=1+x-\frac{14}{27}x^2.
 \end{equation*}
% so that the exact solution is
% \begin{equation}\label{exact of Ex3}
% u_{exact}=\sin x+\cos x=(x-\frac{x^3}{3!}+\ldots)+(1-\frac{x^2}{2!}+\ldots)=1+x-\frac{x^2}{2!}+\ldots
% \end{equation}
\begin{table}[h]\caption{Absolute error of Example 4 }\label{tab3}
\centering
\begin{tabular}{|lllll|}
 \hline
 &\footnotesize{ $x_i$}&\footnotesize{~~~FPM}
&\footnotesize{~~~~Exact}&\footnotesize{~~~~relative error}\\
\hline
&\footnotesize{$0$}&\footnotesize{~~~$1.0000$}&\footnotesize{~~~~$1.0000$}&\footnotesize{~~~~$0$}\\
 &\footnotesize{$0.1$}&\footnotesize{~~~$1.0948$}&\footnotesize{~~~~$1.0948$}&\footnotesize{~~~~$0$}\\
 &\footnotesize{$0.2$}&\footnotesize{~~~$1.1793$}&\footnotesize{~~~~$1.1787$}&\footnotesize{~~~~$4.0E-04$}\\
 &\footnotesize{$0.3$}&\footnotesize{~~~$1.2533$}&\footnotesize{~~~~$1.2509$}&\footnotesize{~~~~$2.0E-03$}\\
 &\footnotesize{$0.4$}&\footnotesize{~~~$1.3170$}&\footnotesize{~~~~$1.3105$}&\footnotesize{~~~~$5.0E-03
$}\\
 &\footnotesize{$0.5$}&\footnotesize{~~~$1.3704$}&\footnotesize{~~~~$1.3570$}&\footnotesize{~~~~$9.8E-03$}\\
 &\footnotesize{$0.6$}&\footnotesize{~~~$1.4133$}&\footnotesize{~~~~$1.3900$}&\footnotesize{~~~~$1.68E-02$}\\
 &\footnotesize{$0.7$}&\footnotesize{~~~$1.4459$}&\footnotesize{~~~~$1.4091$}&\footnotesize{~~~~$2.62E-02$}\\
 &\footnotesize{$0.8$}&\footnotesize{~~~$1.4681$}&\footnotesize{~~~~$1.4141$}&\footnotesize{~~~~$3.82E-02$}\\
 &\footnotesize{$0.9$}&\footnotesize{~~~$1.4800$}&\footnotesize{~~~~$1.4049$}&\footnotesize{~~~~$5.34E-02$}\\
  &\footnotesize{$RMSE=7.4E-03$}&&&\\
 \hline
\end{tabular}
\end{table}
The exact solution ($u(x)=\sin x+\cos x$)
  and the FPM solutions are depicted in Fig. 3. The relative errors of them are shown in Table. 3.
\ref{fig3}.
\begin{figure}
\centering
\includegraphics[angle=0,
width=0.5\textwidth]{Pourghanbar3.eps}
\caption{Exact solution and FPM (Example 4).}
\end{figure}
%%%%%%%%%
%\ref{fig3}.
%\begin{figure}
%\begin{center}
%% Requires \usepackage{graphicx}\
%\includegraphics[width=.6in,height=.6in]{Pourghanbar3.eps}
%\caption{Exact solution and FPM (Example 4)}\label{fig1}
%\end{center}
%\end{figure}
%%%%%%%%%
\begin{Rem} %to create the remark
We have verified all the examples with the aid of MATLAB R2013a.
\end{Rem}
\section{Conclusion}
In this article we have studied the functional perturbation method (FPM) which is an effective tool for analytical solution of linear problems and can be used for some nonlinear problems too. We expand differential equations functionally, yielding some ODEs which have constant coefficients and  differ only in their right hand side. The right hand side functions that exist in each step, correct the inconsistencies of all previous approximations. The initial condition is fulfilled by the zero-order approximation only. Higher-order approximations are considered with homogeneous conditions. We have successfully applied the proposed approach to solve four equations.
  First, the idea of FPM is applied for linear equations, then we generate the idea to a nonlinear differential equation. In the nonlinear case, the unknown $u$ is replaced by two terms of Taylor expansion $\tilde{u}$.
  For polynomial case, the exact solution is obtained by only the first term of expansion. The results have shown that the new described idea produces acceptable results.


\section{Bibliography}
\begin{thebibliography}{99}
\bibitem{Altus Analysis of Bernoulli beams}  Altus, E.,
{\em Analysis of Bernoulli beams with 3D stochastic heterogeneity}, PROBABILIST ENG MECH. 18, 301-314, (2003).
\bibitem{Altus A new functional} Altus, E., Proskura, A.,  Givli, S., {\em A new functional perturbation method for linear non-homogeneous materials}, INT J SOLIDS STRUCT. 42, 1577-1595, (2005).
\bibitem{Altus Microstress estimate}Altus, E.,{\em Microstress estimate of stochastically heterogeneous structures by the
functional perturbation method: A one dimensional example}, PROBABILIST ENG MECH. 21, 434-441, (2006).
 \bibitem{Altus Buckling of stochastically}Altus, E., Totry, E.,{\em Buckling of stochastically heterogeneous beams using a functional perturbation method}, INT J SOLIDS STRUCT. 40, 6547-6565, (2003).
\bibitem{Barles1998}Barles, G., Soner, H.M., {\em Option pricing with transaction costs and a nonlinear Black Scholes equatio}, Finance and Stochastics. 2, 369-397, (1998).
\bibitem{Beran Statistical continuum mechanics}M. Beran, M., {\em Statistical continuum mechanics}, Interscience Publishers. (1968).
\bibitem{DehghanPourghanbar}Dehghan, M., Pourghanbar, S., {\em Solution of the Black-Scholes equation for pricing of barrier option}, Z Naturforsch A. 66a, 289-296, (2011).
 \bibitem{Adomian in this j} Duan, J.S., Rach, R., Lin, S.M., {\em Analytic approximation of the blow-up time for nonlinear differential    equations by the ADM Pade technique}. MATH METHOD APPL SCI. 36, 1790-1804, (2013).
\bibitem{An Introduction Washington}  Frigyik, B.A., Srivastava, S., Gupta, M., {\em An Introduction to Functional Derivatives}. Univ. of Washington Dept. of Electrical Enginering Technical Report. 1, 1-7, (2008).
\bibitem{Legendre collocation Jun}Jun, Y.L., Zi-qiang, L., Zhong-qing, W., {\em Legendre�Gauss�Lobatto spectral collocation method for nonlinear delay
differential equations}, MATH METHOD APPL SCI. 36, 2476-2491, (2013).
\bibitem{Kanwal Generalized functions}  R.P. Kanwal, R.P., {\em Generalized functions, Theary and techniques}, Birkhauser, Basel, (1998).

\bibitem{Mohammadzadeh Lakestani} Mohammadzadeh, R., Lakestani, M., Dehghan, M., {\em Collocation method for the numerical solutions of Lane�Emden type equations using cubic Hermite spline functions}, MATH METHOD APPL SCI. 37, 1303-1317, (2014).

 \bibitem{oceanography1} Mysak, L., {\em Wave propagation in random media, with oceanic applications}, REV GEOPHYS. 16, 233-261, (1978).

\bibitem{Altus Natural frequencies} Nachum, S., Altus, E., {\em Natural frequencies and mode shapes of deterministic and stochastic non-homogeneous rods and beams}, J SOUND VIB. 302, 903-924, (2007).

\bibitem{homotopy in this j} Odibat, Z., Bataineh, A.S., {\em  An adaptation of homotopy analysismethod for reliable treatment of strongly nonlinear problems: construction of homotopy polynomials}, MATH METHOD APPL SCI. doi: 10.1002/mma.3136.

\bibitem{Geometric optics1} Osher, S., Cheng, L.T., Kang, M., Shim, H., Tsai, Y.H., {\em Geometric optics in a phase space based level set and Eulerian framework}, J COMPUT PHYS. 79, 622-648, (2002).

\bibitem{Tau method in this j} Taghavi, A., Pearce, S.A., {\em  solution to the Lane�Emden equation in the theory of stellar structure utilizing the tau method}, MATH METHOD APPL SCI. 36, 1240-1247. (2013).

    \bibitem{Altus Buckling of non-uniform}  Totry, E.M., Altus, E., Proskura, A., {\em  Buckling of non-uniform beams by a direct functional perturbation method}, PROBABILIST ENG MECH. 22, 88-99, (2007).

\bibitem{Altus A novel application of} Totry, E.M., Altus, E., Proskura, A., {\em  A novel application of the FPM to the buckling differential equation of non-uniform beams}, PROBABILIST ENG MECH. 23, 339-346, (2008).

    \bibitem{step difference in this j} Wu, J., Zhang, X., {\em A class of multi-step difference schemes by using Pade approximant}, MATH METHOD APPL SCI. 37, 2554-2561, (2014).

 \bibitem{optimal control1} Yildiz, B., Kilicoglu, O., Yagubov, G., {\em  Optimal control problem for nonstationary Schrodinger equation}, NUMER METH PART D E . 25, 1195-1203, (2009).

\bibitem{collocaton method in this j}Y�zbasi, S., {\em A collocation method based on the Bessel functions of the first kind for singular perturbated differential equations and residual correction}, MATH METHOD APPL SCI. doi: 10.1002/mma.3278.

\end{thebibliography}

\end{document}
