<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">APM</journal-id><journal-title-group><journal-title>Advances in Pure Mathematics</journal-title></journal-title-group><issn pub-type="epub">2160-0368</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/apm.2018.812051</article-id><article-id pub-id-type="publisher-id">APM-89217</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Physics&amp;Mathematics</subject></subj-group></article-categories><title-group><article-title>
 
 
  Numerical Solution for Initial and Boundary Value Problems of Fractional Order
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>A.</surname><given-names>M. Kawala</given-names></name><xref ref-type="aff" rid="aff1"><sub>1</sub></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff1"><label>1</label><addr-line>Department of Mathematics, Faculty of Science, Helwan University, Cairo, Egypt</addr-line></aff><pub-date pub-type="epub"><day>19</day><month>12</month><year>2018</year></pub-date><volume>08</volume><issue>12</issue><fpage>831</fpage><lpage>844</lpage><history><date date-type="received"><day>3,</day>	<month>November</month>	<year>2018</year></date><date date-type="rev-recd"><day>16,</day>	<month>December</month>	<year>2018</year>	</date><date date-type="accepted"><day>19,</day>	<month>December</month>	<year>2018</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  Fractional calculus has been used in many fields
  ,
   such as engineering, population, medicine, fluid mechanics and different fields of chemistry and physics. These fields were found to be best described using fractional differential equations (FDEs) to model their processes and equations. One of the well-known methods for solving fractional differential equations is the Shifted Legendre operational matrix (LOM) method. In this article, I proposed a numerical method based on Shifted Legendre polynomials for solving a class of fractional differential equations. A fractional order operational matrix of Legendre polynomials is also derived where the fractional derivatives 
  are
   described by the Caputo derivative sense. By using the operational matrix
  , 
  the initial and boundary equations are transformed into the products of several matrixes and by scattering the coefficients and the products of matrixes
  . 
  I got a system of linear equations. Results obtained by using the proposed method (LOM) presented here show that the numerical method is very effective and appropriate for solving initial and boundary value problems of fractional ordinary differential equations. Moreover, some numerical examples are provided and 
  the
   comparison is presented between the obtained results and those analytical results achieved that have proved the method’s validity.
 
</p></abstract><kwd-group><kwd>Fractional Differential Equations</kwd><kwd> Shifted Legendre Polynomials</kwd><kwd> Operational Matrix</kwd><kwd> Caputo Derivative</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Fractional calculus, the theory of differentiation and integration to non-integer order, is very useful for the description of various physical phenomena, such as damping laws, diffusion process, etc. Fractional differential equations extend prominent tools that are perfectly representing many engineering and physical problems. However, solving fractional differential equations are a challenging and stimulating area of research in mathematics and engineering since these fractional equations do not have exact and analytic solutions and that is the main reason made accurate numerical techniques preferable for solving fractional differential equations.</p><p>Many applications of shifted Legendre polynomials have been exemplified in research [<xref ref-type="bibr" rid="scirp.89217-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.89217-ref2">2</xref>] [<xref ref-type="bibr" rid="scirp.89217-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.89217-ref4">4</xref>]. In this article, an application of Legendre polynomials to solve fractional differential equations is provided. The main aim is to generalize Legendre operational matrix to fractional calculus and based on using the operational matrix of an orthogonal function for solving differential equations. In the last decade or so, extensive research has been done in the numerical development methods that are numerically stable for both linear and nonlinear fractional differential equations [<xref ref-type="bibr" rid="scirp.89217-ref5">5</xref>] - [<xref ref-type="bibr" rid="scirp.89217-ref13">13</xref>]. Orthogonal functions and polynomial series have received appreciable attention in dealing with various problems of dynamic systems. Legendre polynomials are well known family of orthogonal polynomials on the interval [−1, 1] that have many applications [<xref ref-type="bibr" rid="scirp.89217-ref14">14</xref>]. They are widely used because of their good properties in the approximation of functions.</p><p>The proposed method is to obtain the numerical solution for FDE of the form [<xref ref-type="bibr" rid="scirp.89217-ref15">15</xref>] presented in Equation (I)-(III) based on the shifted Legendre method:</p><p>A 1 D 2 y ( x ) + A 2 D 1 y ( x ) + A 3 D α y ( x ) + A 4 D β y ( x ) + A 5 y ( x ) = f ( x ) (I)</p><p>subject to the conditions</p><p>y ( 0 ) = δ ,         y ( 0 ) ′ = δ 1 (II)</p><p>or the boundary conditions</p><p>y ( 0 ) = γ 0 ,       y ( R ) = γ 1 (III)</p><p>where A 1 , A 2 , A 3 , A 4 , A 5 , δ 0 , δ 1 , γ 0 , γ 1 are constants.</p><p>m − 1 &lt; α , β &lt; m and f(x) are the source terms.</p><p>The fractional derivatives are defined in the Caputo sense. The main idea in the current work is to apply the shifted Legendre polynomials and the operational matrix of fractional derivative together to discretize Equation (1) to get a satisfactory result. Figures 1-3 and results in next sections show the effectiveness of the proposed method in comparison with the analytical results.</p><p>The remainder of the article is organized as follows. In the next section, some mathematical preliminaries of the fractional calculus theory are introduced in addition to some relevant properties of the Legendre polynomials. Section 3 summarizes the application of the shifted Legendre method to the solution of problems (I)-(III). As a result, a system of algebraic equations is obtained and the solution of the considered problem is given. Section 4 illustrates applying the Legendre operational matrix of fractional derivative for solving multi-order fractional differential equation. In Section 5, the proposed method is applied to several examples. Finally, conclusion is given in Section 6. The numerical results are all computed using Mathematica Development Environment.</p></sec><sec id="s2"><title>2. LOM Preliminaries and Notations</title><p>In this section, some basic definitions and properties of fractional calculus theory are given that are further used in this article.</p><sec id="s2_1"><title>2.1. The Fractional Derivative in the Caputo Sense</title><p>The fractional calculus is a name for the theory of integrals and derivatives of arbitrary order, which unifies and generalizes the notions of integer-order differentiation and n-fold integration [<xref ref-type="bibr" rid="scirp.89217-ref16">16</xref>] [<xref ref-type="bibr" rid="scirp.89217-ref17">17</xref>]. There are various definitions of fractional integration and differentiation, such as Grunwald_Letnikov’s definition and Riemann_Liouville’s definition. In the present work, the fractional derivatives are considered in the Caputo sense. The reason for adopting the Caputo definition, as pointed by [<xref ref-type="bibr" rid="scirp.89217-ref18">18</xref>] , is as follows: to solve differential equations (both classical and fractional), I need to specify additional conditions in order to produce a unique solution. For the case of the Caputo fractional differential equations, these additional conditions are just the traditional conditions, which are akin to those of classical differential equations, and are therefore familiar to us. In contrast, for the Riemann_Liouville fractional differential equations, these additional conditions constitute certain fractional derivatives (and/or integrals) of the unknown solution at the initial point x = 0, which are functions of x. For more details see [<xref ref-type="bibr" rid="scirp.89217-ref19">19</xref>].</p><p>Definition 2.1. The Caputo definition of the fractional-order derivative is defined as</p><p>D α f ( x ) = 1 Γ ( n − α ) ∫ 0 x f ( n ) ( t ) ( x − t ) α + 1 − n d t ,     n − 1 &lt; α ≤ n ,     n ∈ N , (1)</p><p>where, α &gt; 0 is the order of the derivative and n is the smallest integer greater than α For the Caputo derivative I have [<xref ref-type="bibr" rid="scirp.89217-ref20">20</xref>]</p><p>D α C = 0 (C is a constant), (2)</p><p>D α x β = { 0 ,                                                 for   β ∈ N 0   and   β &lt; α Γ ( β + 1 ) Γ ( β + 1 − α ) x β − α ,     for   β ∈ N 0   and   β ≥ α   or   β ∉ N   and   β &gt; α (3)</p><p>I use the ceiling function, ⌈ α ⌉ to denote the smallest integer greater than or equal to α , and the floor function ⌊ α ⌋ to denote the largest integer less than or equal to α . Also N = { 1 , 2 , ⋯ } and N 0 = { 0 , 1 , 2 , ⋯ } . Recall that for α ∈ N , the Caputo differential operator coincides with the usual differential operator of an integer order.</p></sec><sec id="s2_2"><title>2.2. Properties of Shifted Legendre Polynomials</title><p>The well-known Legendre polynomials are defined on the interval [ − 1 , 1 ] and can be determined with the aid of the following recurrence formulae:</p><p>L i + 1 ( z ) = 2 i + 1 i + 1 z L i ( z ) − i i + 1 L i − 1 ( z ) ,         i = 1 , 2 , ⋯</p><p>where L 0 ( z ) = 1 and L 1 ( z ) = z . In order to use these polynomials on the interval x ∈ [ 0 , 1 ] I define the so-called shifted Legendre polynomials by introducing the change of variable.</p><p>z = 2 x − 1 . Let the shifted Legendre polynomials L i ( 2 x − 1 ) be denoted by P i ( x ) . Then P i ( x ) can be obtained as follows:</p><p>P i + 1 ( x ) = ( 2 i + 1 ) ( 2 x − 1 ) i + 1 P i ( x ) − i i + 1 P i − 1 ( x ) ,     i = 1 , 2 , ⋯ , (5)</p><p>where P 0 ( x ) = 1 and P 1 ( x ) = 2 x − 1 . The analytic form of the shifted Legendre polynomial P i ( x ) of degree i given by</p><p>P i ( x ) = ∑ k = 0 i ( − 1 ) i + k ( i + k ) ! ( i − k ) ! ( k ! ) 2 x k (6)</p><p>Note that P i ( 0 ) = ( − 1 ) i and P i ( 1 ) = 1 The orthogonality condition is</p><p>∫ 0 1 p i ( x ) p j ( x ) d x = { 1 2 i + 1           for   i = j 0                     for   i ≠ j (7)</p><p>A function y ( x ) , square integrable in [ 0 , 1 ] , may be expressed in terms of shifted Legendre polynomials as</p><p>y ( x ) = ∑ j = 0 ∞ c j P j ( x ) ,</p><p>where c j the coefficients are given by P j (x)</p><p>c j = ( 2 j + 1 ) ∫ 0 1 y ( x ) p j ( x ) d x ,     j = 1 , 2 , ⋯</p><p>In practice, only the first ( m + 1 ) - terms shifted Legendre polynomials are considered. Then I have</p><p>y ( x ) = ∑ j = 0 m   c j P j ( x ) = C T ϕ ( x ) ,</p><p>where the shifted Legendre coefficient vector C and the shifted Legendre vector ϕ ( x ) are given by</p><p>C T = [ c 0 , ⋯ , c m ] ,</p><p>ϕ ( x ) = [ P 0 ( x ) , P 1 ( x ) , ⋯ , P m ( x ) ] T (8)</p><p>The derivative of the vector ϕ ( x ) can be expressed by</p><p>d ϕ ( x ) d x = D ( 1 ) ϕ ( x ) , (9)</p><p>where D ( 1 ) is the ( m + 1 ) &#215; ( m + 1 ) operational matrix of derivative given by</p><p>D ( 1 ) = ( d i j ) = { 2 ( 2 j + 1 ) ,       for   j = i − k ,   { k = 1 , 3 , ⋯ , m ,               if   m   odd k = 1 , 3 , ⋯ , m − 1 ,       if   m   even 0 ,                             otherwise ,</p><p>for example for even m I had</p><p>D ( 1 ) = 2 ( 0 0 0 0 ⋯ 0 0 0 1 0 0 0 ⋯ 0 0 0 0 3 0 0 ⋯ 0 0 0 1 0 5 0 ⋯ 0 0 0 ⋮ ⋮ ⋮ ⋮ ⋱ ⋮ ⋮ ⋮ 1 0 5 0 ⋯ 2 m − 3 0 0 0 3 0 7 ⋯ 0 2 m − 1 0 )</p></sec></sec><sec id="s3"><title>3. Generalized Legendre Operational Matrix to Fractional Calculus</title><p>By using Equation (9), it is clear that</p><p>d n ϕ ( x ) d x n = ( D ( 1 ) ) n ϕ ( x ) , (10)</p><p>where n ∈ N and the superscript, in D ( 1 ) , denotes matrix powers. Thus</p><p>D ( n ) = ( D ( 1 ) ) n ,     n = 1 , 2 , ⋯ (11)</p><p>Lemma 1. Let P i ( x ) be a shifted Legendre polynomial then</p><p>D ( α ) P i ( x ) = 0 ,       i = 0 , 1 , ⋯ , ⌈ α ⌉ − 1 , α &gt; 0 (12)</p><p>Proof. Using Equations (2), (3) in Equation (6) the lemma can be proved.</p><p>In the following theorem I generalize the operational matrix of derivative of shifted Legendre polynomials given in (9) for fractional derivative.</p><p>Theorem 1. Let ϕ ( x ) be shifted Legendre vector defined in (8) and also suppose, α &gt; 0 then</p><p>D α ϕ ( x ) ≃ D ( α ) ϕ ( x ) (13)</p><p>where D ( α ) is the ( m + 1 ) &#215; ( m + 1 ) operational matrix of fractional derivative of order α in the Caputo sense and is defined as follows:</p><p>D ( α ) = ( 0 0 ⋯ 0 ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ 0 ∑ k = ⌈ α ⌉ ⌈ α ⌉ θ ⌈ α ⌉ , 0 , k ∑ k = ⌈ α ⌉ ⌈ α ⌉ θ ⌈ α ⌉ , 1 , k ⋯ ∑ k = ⌈ α ⌉ ⌈ α ⌉ θ ⌈ α ⌉ , m , k ⋮ ⋮ ⋱ ⋮ ∑ k = ⌈ α ⌉ i θ i , 0 , k ∑ k = ⌈ α ⌉ i θ i , 1 , k ⋯ ∑ k = ⌈ α ⌉ i θ i , m , k ⋮ ⋮ ⋱ ⋮ ∑ k = ⌈ α ⌉ m θ m , 0 , k ∑ k = ⌈ α ⌉ m θ m , 1 , k ⋯ ∑ k = ⌈ α ⌉ m θ m , m , k ) (14)</p><p>where θ i , j , k is given by</p><p>θ i , j , k = ( 2 j + 1 ) ∑ i = 0 j ( − 1 ) i + j + k + l ( i + k ) ! ( l + j ) ! ( i − k ) ! ( k ! ) Γ ( k − α + 1 ) ( j − l ) ! ( l ! ) 2 ( k + l − α + 1 ) (15)</p><p>Note that in D ( α ) the first ⌈ α ⌉ rows, are all zero.</p><p>Proof. Using Equations (3), (4) and (6) I have</p><p>D α p i ( x ) = ∑ k = 0 i ( − 1 ) i + k ( i + k ) ! ( i − k ) ! ( k ! ) 2 D α ( x k ) = ∑ k = ⌈ α ⌉ i ( − 1 ) i + k ( i + k ) ! ( i − k ) ! ( k ! ) Γ ( k − α + 1 ) x k − α ,     i = ⌈ α ⌉ , ⋯ , m (16)</p><p>Now, approximate x k − α by ( m + 1 ) terms of shifted Legendre series, I have</p><p>x k − α ≃ ∑ j = 0 m b k , j P j ( x ) , (17)</p><p>where</p><p>b k , j = ( 2 j + 1 ) ∫ 0 1 x k − α p j ( x ) d x = ( 2 j + 1 ) ∑ l = 0 j ( − 1 ) j + l ( j + l ) ! ( j − l ) ! ( l ! ) 2 ∫ 0 1 x k + l − α d x = ( 2 j + 1 ) ∑ l = 0 j ( − 1 ) j + l ( j + l ) ! ( j − l ) ! ( l ! ) 2 ( k + l − α + 1 ) (18)</p><p>Employing Equations (16)-(18) I get</p><p>D α P i ( x ) ≈ ∑ k = ⌈ α ⌉ i ∑ j = 0 m ( − 1 ) i + k ( i + k ) ! ( i − k ) ! ( k ! ) Γ ( k − α + 1 ) b k , j P j ( x ) = ∑ j = 0 m ( ∑ k = ⌈ α ⌉ i θ i , j , k ) P j ( x )   ,       i = ⌈ α ⌉ , ⋯ , m (19)</p><p>where θ i , j , k is given in Equation (15). Rewrite Equation (19) as a vector form I have</p><p>D ( α ) P i ( x ) ≃ [ ∑ k = ⌈ α ⌉ i θ i , 0 , k , ∑ k = ⌈ α ⌉ i θ i , 1 , k , ⋯ , ∑ k = ⌈ α ⌉ i θ i , m , k ] ϕ ( x ) ,     i = ⌈ α ⌉ , ⋯ , m (20)</p><p>Also according to Lemma 1, I can write</p><p>D ( α ) P i ( x ) = [ 0 , 0 , ⋯ , 0 ] ϕ ( x ) ,     i = 0 , 1 , ⋯ , ⌈ α ⌉ − 1 (21)</p><p>A combination of Eqs. (20) and (21) leads to the desired result.</p><p>Remark. If α = n ∈ N Then Theorem 1 gives the same result as Equation (11).</p></sec><sec id="s4"><title>4. Applications of the Operational Matrix of Fractional Derivative</title><p>Operational matrix of fractional derivative is applied to solve multi-order fractional differential equation. The existence and uniqueness and continuous dependence of the solution to this problem are discussed in [<xref ref-type="bibr" rid="scirp.89217-ref21">21</xref>].</p><sec id="s4_1"><title>4.1. Linear Multi-Order Fractional Differential Equation [<xref ref-type="bibr" rid="scirp.89217-ref22">22</xref>]</title><p>Consider the linear multi-order fractional differential equation</p><p>D α y ( x ) = a 1 D β 1 y ( x ) + ⋯ + a k D β k y ( x ) + a k + 1 y ( x ) − a k + 2 g ( x ) (22)</p><p>with initial conditions</p><p>y ( i ) ( 0 ) = d i ,       i = 0 , ⋯ , n (23)</p><p>where j = 1 , ⋯ , k + 2 are real constant coefficients and also n &lt; α ≤ n + 1 , 0 &lt; β 1 &lt; β 2 &lt; ⋯ &lt; β k &lt; α and D α denotes the Caputo fractional derivative of order α</p><p>To solve problem (22) and (23) I approximate y ( x ) and g ( x ) by the shifted Legendre polynomials as</p><p>y ( x ) ≃ ∑ i = 0 m c i P i ( x ) = C T ϕ ( x ) (24)</p><p>g ( x ) ≃ ∑ i = 0 m g i P i ( x ) = G T ϕ ( x ) (25)</p><p>where vector G = [ g 0 , ⋯ , g m ] T is known but C = [ c 0 , ⋯ , c m ] T is an unknown vector. By using Equations (13) and (24) I have</p><p>D α y ( x ) ≃ c T D α ϕ ( x ) ≃ c T D ( α ) ϕ ( x ) (26)</p><p>D β j y ( x ) ≃ c T D β j ϕ ( x ) ≃ c T D ( β j ) ϕ ( x ) ,       j = 1 , ⋯ , k (27)</p><p>Employing Equations (24)-(27) the residual R m ( x ) for Equation (22) can be written as</p><p>R m ( x ) ≃ ( c T D ( α ) − c T ∑ i = 1 k a j D ( β j ) − c T a k + 1 − G T a k + 2 ) ϕ ( x ) (28)</p><p>As in a typical tau method [<xref ref-type="bibr" rid="scirp.89217-ref23">23</xref>] I generate m − n linear equations by applying</p><p>〈 R m ( x ) , P j ( x ) 〉 = ∫ 0 1 R m ( x ) P j ( x ) d x = 0 ,       j = 0 , 1 , ⋯ , m − n − 1 (29)</p><p>Also, by substituting Equations (11) and (24) in Equation (23) I get</p><p>y ( 0 ) = c T ϕ ( 0 ) = d 0 y ( 1 ) ( 0 ) = c T D ( 1 ) ϕ ( 0 ) = d 1                       ⋮ y ( n ) ( 0 ) = c T D ( n ) ϕ ( 0 ) = d n (30)</p><p>Equations (29) and (30) generate m − n and n +1 set of linear equations, respectively. These linear equations can be solved for unknown coefficients of the vector C. Consequently, y(x) given in Equation (24) can be calculated.</p></sec><sec id="s4_2"><title>4.2. Treatment of Nonhomogeneous Boundary Conditions</title><p>To solve Equation (22) with respect to the following boundary conditions (for n is even),</p><p>u ( i ) ( 0 ) = a i ,       u ( i ) ( L ) = b i ,       i = 0 , 1 , ⋯ , n 2 − 1 (31)</p><p>The same technique described in Section 4.1 was applied, but the (n) set of linear equations resulting from (31) is changed to be obtained from</p><p>u ( i ) ( 0 ) = c T D ( i ) ϕ ( 0 ) = a i ,     u ( i ) ( L ) = c T D ( i ) ϕ ( L ) = b i ,       i = 0 , 1 , ⋯ , n 2 − 1 (32)</p><p>Equations (29) and (31) generate (N + 1) system of linear equations. This system can be solved to determine the unknown coefficients of the vector C.</p></sec><sec id="s4_3"><title>4.3. Nonlinear Multi-Order Fractional Differential Equation</title><sec id="s4_3_1"><title>4.3.1. Consider the Nonlinear Multi-Order Fractional Differential Equation</title><p>D α y ( x ) = F ( x , y ( x ) , D β 1 y ( x ) , ⋯ , D β k y ( x ) ) , (33)</p><p>with initial conditions</p><p>y ( i ) ( 0 ) = d i ,       i = 0 , ⋯ , n (34)</p><p>where n &lt; α ≤ n + 1 , 0 &lt; β 1 &lt; β 2 &lt; ⋯ &lt; β k &lt; α and D α denotes the Caputo fractional derivative of order α . It should be noted that F can be nonlinear in general.</p><p>In order to use shifted Legendre polynomials for this problem, I first approximate y ( x ) , D α y ( x ) and D β j y ( x ) for j = 0 , ⋯ , k as Equations (24), (26) and (27) respectively. By substituting these equations in Equation (33) I get</p><p>C T D ( α ) φ ( x ) ≈ F ( x , C T φ ( x ) , C T D ( β 1 ) φ ( x ) , ⋯ , C T D ( β k ) φ ( x ) ) (35)</p><p>Also, by substituting Equations (11) and (24) in Equation (34) I obtain</p><p>y ( 0 ) = c T ϕ ( 0 ) = d 0 ,</p><p>y ( i ) ( 0 ) = c T D ( i ) ϕ ( 0 ) = d i ,     i = 1 , 2 , ⋯ , n (36)</p><p>To find the solution y(x), I first collocate Equation (35) at m − n points. For suitable collocation points I use the first (m-n) shifted Legendre roots of P m + 1 ( x ) . These equations together with Equation (36) generate a system of (.m + 1) nonlinear equations which can be solved using Newton’s iterative method. Consequently y(x) given in Equation (24) can be calculated.</p></sec><sec id="s4_3_2"><title>4.3.2. Boundary Value Problem</title><p>Consider the nonlinear FDE (33) with boundary conditions (31). I apply the same technique described in Section 4.3.1, but Equation (36) shall be changed to be (32)., I have a system of (N + 1) nonlinear algebraic equations, which can be solved using Newton’s iterative method.</p></sec></sec></sec><sec id="s5"><title>5. Numerical Results</title><p>The presented method in the previous two sections has been applied to solve some examples. In this section, the results for the examples are shown along with their figures and a comparison with the analytical results was also presented in order to show the effectiveness of the technique.</p><p>Example 1. [<xref ref-type="bibr" rid="scirp.89217-ref24">24</xref>] Consider the linear fractional-order IVP:</p><p>y ( 2 ) ( x ) + 3 y ( 1 ) ( x ) + 2 y ( 0.1379 ) ( x ) + y ( 0.0159 ) ( x ) + 5 y ( x ) = f ( x ) ,     x ∈ ( 0 , 1 ) , (37)</p><p>Subject to the initial conditions</p><p>y ( 0 ) = 1 ,       y ′ ( 0 ) = 0 (38)</p><p>where f(x) is chosen such that the exact solution of (37) is y ( x ) = 1 + x 2 2</p><p>By applying the technique described in Section 4.1 with m = 3, solution approximated as</p><p>y ( x ) = c 0 p 0 ( x ) + c 1 p 1 ( x ) + c 2 p 2 ( x ) + c 3 p 3 ( x ) = c T φ (x)</p><p>Here, I have</p><p>D ( 1 ) = ( 0 0 0 0 2 0 0 0 0 6 0 0 2 0 10 0 ) D ( 2 ) = ( 0 0 0 0 0 0 0 0 12 0 0 0 0 60 0 0 )</p><p>D ( 1.379 ) = ( 0 0 0 0 1.1313681331 1.0223463203 − 0.0608397666 0.0199340611 − 1.0223463203 0.36356929917 1.196322451 − 0.093190361 1.07052836676 − 0.17397613077 0.3074747759 1.2963937228 )</p><p>D ( 0.0159 ) = ( 0 0 0 0 1.01472967373 1.0039162279 − 0.00667748802491 0.00190548426 − 1.0039162279 0.03644683 1.0231320558 − 0.00944784045 1.0080521857 − 0.01921582796 0.02742824636 1.03280174727 )</p><p>G = ( 9.2199297 4.10949395 0.918660451 0.03295167 )</p><p>Therefore using Equation (29) I obtain</p><p>− 9.2199297 + 5 c 0 + 9.2774659 c 1 + 8.95139113 c 2 + 9.1491089 c 3 = 0 (39)</p><p>− 4.1094939 + 8.04860886 c 1 + 18.763585 c 2 + 59.6328319 c 3 = 0 (40)</p><p>Now, by applying Equation (30) I have</p><p>− 1 + c 0 − c 1 + c 2 − c 3 = 0 (41)</p><p>2 c 1 − 6 c 2 + 12 c 3 = 0 (42)</p><p>Finally by solving Equations (39)-(42) I got</p><p>c 0 = 1.17436533 ; c 1 = 0.2662085 ; c 2 = 0.09495018 ; c 3 = 0.003107</p><p>Thus I can write</p><p>y ( x ) = ( 1.17436533 0.2662085 0.09495018 0.003107 )     &#215; ( 1 − 1 + 2 x 1 − 6 x + 6 x 2 − 1 + 12 x − 30 x 2 + 20 x 3 ) = 1 + x 2 2</p><p>which is the exact solution.</p><p>Example 2. Consider the boundary value problem</p><p>D 3 2 y ( x ) + y ( x ) = x 5 − x 4 + 128 7 π x 3.5 − 64 5 π x 2.5</p><p>subject to boundary conditions (43)</p><p>y ( 0 ) = 0 ,     y ( 1 ) = 0</p><p>where the exact solution of this problem is y ( x ) = x 4 ( x − 1 ) .</p><p>This fractional boundary value problem is solved by applying the method described in Section 4.2 by using shifted Legendre expansion and its operational matrices of derivatives with m = 5. Using (43) four linear equations obtained, and by applying boundary condition I had two linear equations. By solving this linear system I got the unknown vector C. By substituting this vector in Equation (43), I had the exact solution.</p><p>y ( x ) = ∑ i = 0 5   c i p i (x)</p><p>Then, the 6 unknown coefficients will be in the form</p><p>c 0 = − 0.033333 ; c 1 = − 0.042857 ; c 2 = 0.0119047 ; c 3 = 0.0388888 ; c 4 = 0.02142857 ; c 5 = 0.00396825</p><p>Therefore, I can write</p><p>y ( x ) = ( − 0.033333 − 0.042857 0.0119047 0.0388888 0.02142857 0.00396825 )     &#215; ( 1 − 1 + 2 x 1 − 6 x + 6 x 2 − 1 + 12 x − 30 x 2 + 20 x 3 1 − 20 x + 90 x 2 − 140 x 3 + 70 x 4 − 1 + 30 x − 210 x 2 + 560 x 3 − 630 x 4 + 252 x 5 ) = x 4 ( x − 1 )</p><p>Numerical results will not be presented since the exact solution is obtained.</p><p>Example 3. [<xref ref-type="bibr" rid="scirp.89217-ref25">25</xref>] Consider the equation</p><p>D 2 u ( x ) + D 3 4 u ( x ) + u ( x ) = x 3 + 6 x + 128 15 Γ ( 1 4 ) x 9 4 (44)</p><p>Subject to initial conditions u ( 0 ) = 0 , u ′ ( 0 ) = 0</p><p>where the exact solution of this problem is u ( x ) = x 3</p><p>By applying the technique described in Section 4.1 with m = 3, the approximate solution and the right hand side may be written in the form</p><p>u ( x ) ≃ ∑ i = 1 3 c i p i ( x ) = c T ϕ (x)</p><p>g ( x ) ≃ ∑ i = 1 3 g i p i ( x ) = G T ϕ (x)</p><p>Here, I have</p><p>D ( 2 ) = ( 0 0 0 0 0 0 0 0 12 0 0 0 0 60 0 0 ) G = ( 13 4 + 512 195 Gamma [ 1 4 ] 3 ( 23 20 + 1536 1105 Gamma [ 1 4 ] ) 5 ( 1 20 + 512 1547 Gamma [ 1 4 ] ) 7 ( 1 140 + 512 38675 Gamma [ 1 4 ] ) )</p><p>D ( 3 / 4 ) = ( 0 0 0 0 8 5 8 15 − 8 39 392 3315 − 8 15 216 65 56 51 − 88 195 272 195 − 48 85 1264 273 5488 3315 )</p><p>Therefore, using Equation (4.8) I obtain</p><p>8 c 1 5 + 172 c 2 15 + 272 c 3 195 − 13 4 − 512 195 Gamma [ 1 4 ] + c 0 = 0 (45)</p><p>( 8 c 1 15 + 216 c 2 65 + 5052 c 3 85 ) − 153 20 − 22016 3315 Gamma [ 1 4 ] + c 1 = 0 (46)</p><p>Now, by applying Equation (4.9), I have</p><p>c T φ ( 0 ) = c 0 − c 1 + c 2 − c 3 = 0 (47)</p><p>c T D ( 1 ) φ ( 0 ) = 2 c 1 − 6 c 2 + 12 c 3 = 0 (48)</p><p>Finally, by solving linear system of four Equations (45)-(48), I obtained</p><p>u ( x ) = ( 0.25 0.45 0.25 0.05 ) ( 1 − 1 + 2 x 1 − 6 x + 6 x 2 − 1 + 12 x − 30 x 2 + 20 x 3 ) = x 3</p><p>which is the exact solution.</p><p>It is clear that in Examples 1 - 3 the present method can be considered as an efficient method.</p></sec><sec id="s6"><title>6. Conclusion</title><p>Shifted Legendre approximation method for solving higher order fractional differential equations has been presented. These equations are transformed to a system of algebraic equations to provide a matrix representation. The solution is expressed as a truncated Legendre series, and so it can be easily evaluated for arbitrary values by using computer program. From illustrative examples, it can be seen that this matrix approach can obtain very accurate and satisfactory results. The solution obtained is in very excellent agreement with the already existing ones and shows that this approach can solve the problems effectively. Comparisons between approximate solutions and analytical solutions illustrate the validity and the great potential of the technique.</p></sec><sec id="s7"><title>Conflicts of Interest</title><p>The author declares no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s8"><title>Cite this paper</title><p>Kawala, A.M. (2018) Numerical Solution for Initial and Boundary Value Problems of Fractional Order. Advances in Pure Mathematics, 8, 831-844. https://doi.org/10.4236/apm.2018.812051</p></sec></body><back><ref-list><title>References</title><ref id="scirp.89217-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Saadatmandi, A., Razzaghi, M. and Dehghan, M. (2005) Hartley Series Approximations for the Parabolic Equations. International Journal of Computer Mathematics, 82, 1149-1156.</mixed-citation></ref><ref id="scirp.89217-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Saadatmandi, A. and Dehghan, M. (2006) A Tau Method for the One-Dimensional Parabolic Inverse Problem Subject to Temperature over Specification. Computers &amp; Mathematics with Applications, 52, 933-940.</mixed-citation></ref><ref id="scirp.89217-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Saadatmandi, A. and Dehghan, M. (2008) Numerical Solution of a Mathematical Model for Capillary Formation in Tumor Angiogenesis via the Tau Method. Communications in Numerical Methods in Engineering, 24, 1467-1474.</mixed-citation></ref><ref id="scirp.89217-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Saadatmandi, A. and Dehghan, M. (2007) Numerical Solution of the One-Dimensional Wave Equation with an Integral Condition. Numerical Methods for Partial Differential Equations, 23, 282-292. https://doi.org/10.1002/num.20177</mixed-citation></ref><ref id="scirp.89217-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Momani, S. and Shawagfeh, N.T. (2006) Decomposition Method for Solving Fractional Riccati Differential Equations. Applied Mathematics and Computation, 182, 1083-1092. https://doi.org/10.1016/j.amc.2006.05.008</mixed-citation></ref><ref id="scirp.89217-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Gejji, V.D. and Jafari, H. (2007) Solving a Multi-Order Fractional Differential Equation. Applied Mathematics and Computation, 189, 541-548. https://doi.org/10.1016/j.amc.2006.11.129</mixed-citation></ref><ref id="scirp.89217-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Wang, Q. (2006) Numerical Solutions for Fractional KdV-Burgers Equation by Adomian Decomposition Method. Applied Mathematics and Computation, 182, 1048-1055. https://doi.org/10.1016/j.amc.2006.05.004</mixed-citation></ref><ref id="scirp.89217-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Inc, M. (2008) The Approximate and Exact Solutions of the Space and Time-Fractional Burgers Equations with Initial Conditions by Variational Iteration Method. Journal of Mathematical Analysis and Applications, 45, 476-484.https://doi.org/10.1016/j.jmaa.2008.04.007</mixed-citation></ref><ref id="scirp.89217-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Momani, S. and Odibat, Z. (2006) Analytical Approach to Linear Fractional Partial Differential Equations Arising in Fluid Mechanics. Physics Letters A, 355, 271-279.https://doi.org/10.1016/j.physleta.2006.02.048</mixed-citation></ref><ref id="scirp.89217-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Odibat, Z. and Momani, S. (2006) Application of Variational Iteration Method to Nonlinear Differential Equations of Fractional Order. International Journal of Nonlinear Sciences and Numerical Simulation, 7, 271-279. https://doi.org/10.1515/IJNSNS.2006.7.1.27</mixed-citation></ref><ref id="scirp.89217-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Hashim, I., Abdulaziz, O. and Momani, S. (2009) Homotopy Analysis Method for Fractional IVPs. Communications in Nonlinear Science and Numerical Simulation, 14, 674-684. https://doi.org/10.1016/j.cnsns.2007.09.014</mixed-citation></ref><ref id="scirp.89217-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Liua, F., Anh, V. and Turner, I. (2004) Numerical Solution of the Space Fractional Fokker-Planck Equation. Journal of Computational and Applied Mathematics, 166, 209-219. https://doi.org/10.1016/j.cam.2003.09.028</mixed-citation></ref><ref id="scirp.89217-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Esmaeili, S. and Shamsi, M. (2011) A Pseudo-Spectral Scheme for the Approximate Solution of a Family of Fractional Differential Equations. Communications in Nonlinear Science and Numerical Simulation, 16, 3646-3654. https://doi.org/10.1016/j.cnsns.2010.12.008</mixed-citation></ref><ref id="scirp.89217-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Khader, M.M., Sweilam, N.H. and Mahdy, A.M.S. (2011) An Efficient Numerical Method for Solving the Fractional Diffusion Equation. Journal of Applied Mathematics &amp; Bioinformatics, 1, 1-12.</mixed-citation></ref><ref id="scirp.89217-ref15"><label>15</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Mohammadi</surname><given-names> F. </given-names></name>,<etal>et al</etal>. (<year>2014</year>)<article-title>Numerical Solution of Bagley-Torvik Equation Using Chebyshev Wavelet Operational Matrix of Fractional Derivative</article-title><source> International Journal of Applied Mathematics and Mechanics</source><volume> 2</volume>,<fpage> 83</fpage>-<lpage>91</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.89217-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Kilbas, A.A., Srivastava, H.M. and Trujillo, J.J. (2006) Theory and Applications of Fractional Differential Equations. Elsevier, San Diego.</mixed-citation></ref><ref id="scirp.89217-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Das, S. (2008) Functional Fractional Calculus for System Identification and Controls. Springer, New York.</mixed-citation></ref><ref id="scirp.89217-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Momani, S. and Noor, M.A. (2006) Numerical Methods for Fourth-Order Fractional Integro-Differential Equations. Applied Mathematics and Computation, 182, 754-760. https://doi.org/10.1016/j.amc.2006.04.041</mixed-citation></ref><ref id="scirp.89217-ref19"><label>19</label><mixed-citation publication-type="journal" xlink:type="simple"><name name-style="western"><surname>Podlubny</surname><given-names> I. </given-names></name>,<etal>et al</etal>. (<year>2002</year>)<article-title>Geometric and Physical Interpretation of Fractional Integration and Fractional Differentiation</article-title><source> Fractional Calculus and Applied Analysis</source><volume> 5</volume>,<fpage> 367</fpage>-<lpage>386</lpage>.<pub-id pub-id-type="doi"></pub-id></mixed-citation></ref><ref id="scirp.89217-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Diethelm, K., Ford, N.J., Freed, A.D. and Luchko, Yu. (2005) Algorithms for the Fractional Calculus: A Selection of Numerical Methods. Computer Methods in Applied Mechanics and Engineering, 194, 743-773. https://doi.org/10.1016/j.cma.2004.06.006</mixed-citation></ref><ref id="scirp.89217-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">Diethelm, K. and Ford, N.J. (2004) Multi-Order Fractional Differential Equations and Their Numerical Solution. Applied Mathematics and Computation, 154, 621-640. https://doi.org/10.1016/S0096-3003(03)00739-2</mixed-citation></ref><ref id="scirp.89217-ref22"><label>22</label><mixed-citation publication-type="other" xlink:type="simple">Dohaa, E.H., Bhrawyb, A.H. and Ezz-Eldien, S.S. (2011) A Chebyshev Spectral Method Based on Operational Matrix for Initial and Boundary Value Problems of Fractional Order. Computers and Mathematics with Applications, 62, 2364-2373. https://doi.org/10.1016/j.camwa.2011.07.024</mixed-citation></ref><ref id="scirp.89217-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">Canuto, C., Hussaini, M.Y., Quarteroni, A. and Zang, T.A. (1988) Spectral Methods in Fluid Dynamic. Prentice-Hall, Englewood Cliffs. https://doi.org/10.1007/978-3-642-84108-8</mixed-citation></ref><ref id="scirp.89217-ref24"><label>24</label><mixed-citation publication-type="other" xlink:type="simple">Keshavarz, E., Ordokhani, Y. and Razzaghi, M. (2014) Bernoulli Wavelet Operational Matrix of Fractional Order Integration and Its Applications in Solving the Fractional Order Differential Equations. Applied Mathematical Modelling, 38, 6038-6051. https://doi.org/10.1016/j.apm.2014.04.064</mixed-citation></ref><ref id="scirp.89217-ref25"><label>25</label><mixed-citation publication-type="other" xlink:type="simple">Ford, N.J. and Connolly, J.A. (2009) Systems-Based Decomposition Schemes for the Approximate Solution of Multi-Term Fractional Differential Equations. Journal of Computational and Applied Mathematics, 229, 382-391. https://doi.org/10.1016/j.cam.2008.04.003</mixed-citation></ref></ref-list></back></article>