<?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">JAMP</journal-id><journal-title-group><journal-title>Journal of Applied Mathematics and Physics</journal-title></journal-title-group><issn pub-type="epub">2327-4352</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jamp.2017.53053</article-id><article-id pub-id-type="publisher-id">JAMP-74815</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 of Differential Equations by Direct Taylor Expansion
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Pirooz</surname><given-names>Mohazzabi</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Jennifer</surname><given-names>L. Becker</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Department of Mathematics and Physics, University of Wisconsin-Parkside, Kenosha, WI, USA</addr-line></aff><pub-date pub-type="epub"><day>06</day><month>03</month><year>2017</year></pub-date><volume>05</volume><issue>03</issue><fpage>623</fpage><lpage>630</lpage><history><date date-type="received"><day>30,</day>	<month>January</month>	<year>2017</year></date><date date-type="rev-recd"><day>19,</day>	<month>March</month>	<year>2017</year>	</date><date date-type="accepted"><day>22,</day>	<month>March</month>	<year>2017</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>
 
 
  A variation of the direct Taylor expansion algorithm is suggested and applied to several linear and nonlinear differential equations of interest in physics and engineering, and the results are compared with those obtained from other algorithms. It is shown that the suggested algorithm competes strongly with other existing algorithms, both in accuracy and ease of application, while demanding a shorter computation time.
 
</p></abstract><kwd-group><kwd>Taylor Series</kwd><kwd> Expansion</kwd><kwd> Algorithm</kwd><kwd> Numerical Solution</kwd><kwd> Differential Equations</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>With the advent of high speed personal computers and workstations and the decrease of the cost of computer resources in general, numerical methods and computer simulation have become an integral part of the scientific method and a third approach to the study of physical problems, in addition to theoretical and experimental methods.</p><p>The problem of solving differential equations numerically had long been of interest to mathematicians and scientists alike, long before the appearance of modern computers. One of the oldest and simplest algorithms is the Euler me- thod, also known as the Euler-Cauchy method or the polygonal method [<xref ref-type="bibr" rid="scirp.74815-ref1">1</xref>] - [<xref ref-type="bibr" rid="scirp.74815-ref8">8</xref>] . This algorithm utilizes the definition of the derivative of a function,</p><p>d y d x = lim Δ x → 0 Δ y Δ x (1)</p><p>to solve first-order differential equations of the form [<xref ref-type="bibr" rid="scirp.74815-ref9">9</xref>]</p><p>d y d x = f ( x , y ) (2)</p><p>subject to initial condition y ( x 0 ) = y 0 . The method replaces the differential equation by a difference equation and, using a small enough step size Δ x = h , advances the solution from x n to x n + 1 = x n + h through</p><p>y n + 1 = y n + h f ( x n , y n ) (3)</p><p>The Euler method can also be viewed as a Taylor expansion of the function about point x n and retaining only the first two terms. Thus the remaining terms, or the error in the Euler algorithm, is given by</p><p>E = 1 2 ! d 2 y d x 2 | x = ξ h 2 (4)</p><p>where ξ is some value of x in the interval under consideration of width h . Consequently, the local error in the Euler method is of the order of h 2 , resulting in a global error of the order of h . The Euler algorithm is, therefore, first order [<xref ref-type="bibr" rid="scirp.74815-ref10">10</xref>] . Achieving high accuracy with a first-order algorithm in some cases require very small intervals h (hence too many steps), increasing the total computation time and round-off error, resulting in instability of the algorithm.</p><p>An improved version of the Euler method is obtained by retaining three terms in the Taylor expansion of the function instead of two, yielding a second order algorithm [<xref ref-type="bibr" rid="scirp.74815-ref6">6</xref>] . Alternatively, one can advance the solution from x n to x n + 1 by using the value of the derivative at the midpoint of the interval rather that at the beginning,</p><p>y n + 1 = y n + h f [ x n + h 2 ,   y n + h 2 f ( x n , y n ) ] (5)</p><p>This algorithm is known as the modified Euler method, the midpoint method, or the second-order Runge-Kutta method [<xref ref-type="bibr" rid="scirp.74815-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.74815-ref2">2</xref>] [<xref ref-type="bibr" rid="scirp.74815-ref7">7</xref>] . It can be shown that this method is equivalent to the first three terms of the Taylor series described above.</p><p>Yet another way of improving the order of the Euler method is to use the average value of the derivative at the beginning and at the end of each interval,</p><p>y n + 1 = y n + h f ( x n , y n ) + f ( x n + 1 , y n + 1 ) 2 (6)</p><p>where y n + 1 on the right hand side is obtained from Equation (3). This algo- rithm is referred to as the Adams-Bashforth rule [<xref ref-type="bibr" rid="scirp.74815-ref6">6</xref>] , and is second order.</p><p>The accuracy of the Euler method can be improved further by including higher terms of the Taylor expansion in the numerical calculations. Thus, by including the first five terms, one achieves a fourth-order algorithm. This approach, also referred to as the “Creeping up” process, has been mentioned in a limited number of references [<xref ref-type="bibr" rid="scirp.74815-ref7">7</xref>] [<xref ref-type="bibr" rid="scirp.74815-ref11">11</xref>] , but has not received much attention. In particular, the discussion of this method in connection with the differential equations of order higher than one has been very limited in the literature [<xref ref-type="bibr" rid="scirp.74815-ref12">12</xref>] . This is mainly due to the general concern that in all but the simplest cases the necessary higher-order derivatives tend to become quite complicated, rendering the computations extraordinarily tedious [<xref ref-type="bibr" rid="scirp.74815-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.74815-ref8">8</xref>] . Thus, it is believed that the Taylor expansion method is generally not practical if derivatives of higher order than the first are retained. It has also been stated that the method is not suf- ficiently accurate away from the initial point [<xref ref-type="bibr" rid="scirp.74815-ref6">6</xref>] .</p><p>Currently the most widely used numerical algorithms for solving differential equations are the fourth-order Runge-Kutta (RK), fourth-order Adams-Bashforth- Moulton (ABM), and the fourth-order Milne methods. The RK algorithm [<xref ref-type="bibr" rid="scirp.74815-ref12">12</xref>] [<xref ref-type="bibr" rid="scirp.74815-ref13">13</xref>] is single-step, or self starting, and is the most commonly used method among the three. The ABM and the Milne algorithms are multi-steps and are not self starting [<xref ref-type="bibr" rid="scirp.74815-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.74815-ref14">14</xref>] . They are normally started by using a single-step algorithm, such as the RK algorithm.</p><p>The objective of this article is to discuss a variation of the direct Taylor series (DTS) algorithm for the solution of first- and higher-order differential equations. We show that not only this algorithm remains accurate away from the initial point, evaluation of the higher derivatives that are needed for accuracies com- parable to the RK, ABM, and Milne methods are indeed quite simple. Finally, the accuracy and ease of application of the DTS method are explicitly demon- strated by considering several important second-order linear and nonlinear dif- ferential equations of mathematical physics and comparing their solutions using the fourth-order DTS, RK, ABM, and Milne methods.</p></sec><sec id="s2"><title>2. A Variation of the Direct Taylor Series (DTS) Method</title><p>Consider a first-order differential equation given by (2). We expand the solution of this differential equation in a Taylor series about the initial point in each interval x n to obtain its value at the end of that interval x n + 1 = x n + h</p><p>y n + 1 = y n + y n ( 1 ) 1 ! h + y n ( 2 ) 2 ! h 2 + y n ( 3 ) 3 ! h 3 + y n ( 4 ) 4 ! h 4 + ⋯ (7)</p><p>where y n ( 1 ) , y n ( 2 ) , y n ( 3 ) , y n ( 4 ) are the first, second, third, and fourth derivatives of the function evaluated at x = x n . Using the initial condition of the problem, y ( x 0 ) = y 0 , this expansion can be used iteratively to solve the differential equation up to some final value of the independent variable. The higher deri- vatives of the function, which are required in Equation (7), can be obtained by successive differentiation of the original differential Equation (2). Thus,</p><p>{ y ( 1 ) = f ( x , y ) y ( 2 ) = ∂ f ∂ x + ∂ f ∂ y   y ( 1 ) y ( 3 ) = ∂ 2 f ∂ x 2 + 2 ∂ 2 f ∂ x ∂ y   y ( 1 ) + ∂ 2 f ∂ y 2   ( y ( 1 ) ) 2 + ∂ f ∂ y   y ( 2 ) y ( 4 ) = ∂ 3 f ∂ x 3 + 3 ( ∂ 3 f ∂ x 2 ∂ y + ∂ 3 f ∂ x ∂ y 2   y ( 1 ) ) y ( 1 ) + ∂ 3 f ∂ y 3   ( y ( 1 ) ) 3   + 3 ( ∂ 2 f ∂ x ∂ y + ∂ 2 f ∂ y 2   y ( 1 ) ) y ( 2 ) + ∂ f ∂ y   y ( 3 ) ⋮   ⋮   ⋮   ⋮   ⋮ (8)</p><p>Although these equations look tedious, their evaluations in most cases are quite straightforward and result in fairly simple expressions.</p><p>Using terms up to and including the k -th order in Equation (7) (i.e., retaining k + 1 terms), results in a local error of</p><p>E = y ( k + 1 ) ( ξ ) ( k + 1 ) !   h k + 1 (9)</p><p>and, thus, a global error of the order of h k . Since the commonly used high- order numerical algorithms for solving differential equations are fourth order, we restrict our attention to Taylor expansions up to and including the fourth derivative, resulting in a fourth-order algorithm for comparison.</p><p>The DTS algorithm can be extended to numerically solve a differential equa- tion of any order. To demonstrate this, consider a second-order differential equation given by</p><p>d 2 y d x 2 = f ( x , y , y ( 1 ) ) (10)</p><p>subject to the initial conditions y ( x 0 ) = y 0 and y ( 1 ) ( x 0 ) = y 0 ( 1 ) . Of course, this equation can always be reduced to a system of two first-order differential equations. Alternatively, one can extend the Taylor algorithm as follows: From Equation (10) and its differentiation, the second and higher derivatives of the function are obtained and evaluated at x 0 . Then Equation (7) is used to advance the solution from the initial point x 0 to x 1 . To advance the solution from x 1 to x 2 , however, various derivatives of the function at x 1 are needed. These, in turn, can be obtained from the Taylor expansion of the derivatives themselves,</p><p>{ y 1 ( 1 ) = y 0 ( 1 ) + y 0 ( 2 ) 1 ! h + y 0 ( 3 ) 2 ! h 2 + y 0 ( 4 ) 3 ! h 3 + ⋯ y 1 ( 2 ) = y 0 ( 2 ) + y 0 ( 3 ) 1 ! h + y 0 ( 4 ) 2 ! h 2 + y 0 ( 5 ) 3 ! h 3 + ⋯ y 1 ( 3 ) = y 0 ( 3 ) + y 0 ( 4 ) 1 ! h + y 0 ( 5 ) 2 ! h 2 + y 0 ( 6 ) 3 ! h 3 + ⋯ y 1 ( 4 ) = y 0 ( 4 ) + y 0 ( 5 ) 1 ! h + y 0 ( 6 ) 2 ! h 2 + y 0 ( 7 ) 3 ! h 3 + ⋯ ⋮   ⋮   ⋮ (11)</p><p>and, using Equation (7), the solution is advanced from x 1 to x 2 . Iteration of these steps will eventually yield the value of the function at the desired final value of the variable. In Equation (11), the order of the highest derivative retained on the right side of each equation should be the same as the order of the numerical algorithm required. Thus, for a the numerical algorithm to be fourth- order, derivatives up to and including the fourth-order should be included in the expansions.</p><p>The suggested variation of the direct Taylor series, which we refer to as the DTS method, differs from the standard Taylor series method in the following way. In the standard method, the function is calculated at the required value of the variable x directly from the value of the function and its derivatives at the initial value x 0 [<xref ref-type="bibr" rid="scirp.74815-ref15">15</xref>] ,</p><p>y ≅ y 0 + y 0 ( 1 ) 1 ! ( x − x 0 ) + y 0 ( 2 ) 2 ! ( x − x 0 ) 2 + ⋯ + y 0 ( n ) n ! ( x − x 0 ) n (12)</p><p>In the suggested variation of the algorithm (the DTS method), on the other hand, the interval [ x 0 , x ] is divided into many subintervals, each of width h . The function and its derivatives are then Taylor expanded and advanced from subinterval to subinterval until the function is evaluated at the required value of the variable x , thus resulting in a much greater accuracy.</p></sec><sec id="s3"><title>3. Comparison with Other Algorithms</title><p>Applications of the DTS (direct Taylor series) method, as well as other common algorithms, to numerical solutions of first-order differential equations are straightforward and will not be discussed here. <xref ref-type="table" rid="table1">Table 1</xref> summarizes the results for several important second-order differential equations of mathematical physics. Each equation, subject to the given initial conditions, is numerically</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Several linear and nonlinear differential equations of interest. Each equation, subject to the initial conditions described, is numerically evaluated at x = x f , using fourth-order Runge-Kutta (RK), Adams-Bashforth-Moulton (ABM), Milne, and the direct Taylor series (DTS) algorithms. In each cases, a step size of h = 0.1 is used. The true values are given for comparison</title></caption><table><tbody><thead><tr><th align="center" valign="middle" ></th><th align="center" valign="middle" >Differential Equation</th><th align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x56.png" xlink:type="simple"/></inline-formula></th><th align="center" valign="middle" >RK</th><th align="center" valign="middle" >ABM</th><th align="center" valign="middle" >Milne</th><th align="center" valign="middle" >DTS</th><th align="center" valign="middle" >True</th></tr></thead><tr><td align="center" valign="middle" >(a)</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x57.png" xlink:type="simple"/></inline-formula> <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x58.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" >4</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x59.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x60.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x61.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x62.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x63.png" xlink:type="simple"/></inline-formula></td></tr><tr><td align="center" valign="middle" >(b)</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x64.png" xlink:type="simple"/></inline-formula> <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x65.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" >3</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x66.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x67.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x68.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x69.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x70.png" xlink:type="simple"/></inline-formula></td></tr><tr><td align="center" valign="middle" >(c)</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x71.png" xlink:type="simple"/></inline-formula> <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x72.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" >4</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x73.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x74.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x75.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x76.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x77.png" xlink:type="simple"/></inline-formula></td></tr><tr><td align="center" valign="middle" >(d)</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x78.png" xlink:type="simple"/></inline-formula> <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x79.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" >3</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x80.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x81.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x82.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x83.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x84.png" xlink:type="simple"/></inline-formula></td></tr><tr><td align="center" valign="middle" >(e)</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x85.png" xlink:type="simple"/></inline-formula> <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x86.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" >5</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x87.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x88.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x89.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x90.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x91.png" xlink:type="simple"/></inline-formula></td></tr><tr><td align="center" valign="middle" >(f)</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x92.png" xlink:type="simple"/></inline-formula> <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x93.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" >2</td><td align="center" valign="middle" >1.1485</td><td align="center" valign="middle" >1.1485</td><td align="center" valign="middle" >1.1485</td><td align="center" valign="middle" >1.1485</td><td align="center" valign="middle" >1.1485</td></tr><tr><td align="center" valign="middle" >(g)</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x94.png" xlink:type="simple"/></inline-formula> <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x95.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" >2</td><td align="center" valign="middle" >0.6275</td><td align="center" valign="middle" >0.6275</td><td align="center" valign="middle" >0.6275</td><td align="center" valign="middle" >0.6275</td><td align="center" valign="middle" >0.6275</td></tr><tr><td align="center" valign="middle" >(h)</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x96.png" xlink:type="simple"/></inline-formula> <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x97.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" >1</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x98.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x99.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x100.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x101.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x102.png" xlink:type="simple"/></inline-formula></td></tr><tr><td align="center" valign="middle" >(i)</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x103.png" xlink:type="simple"/></inline-formula> <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x104.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" >2</td><td align="center" valign="middle" >0.2338</td><td align="center" valign="middle" >0.2338</td><td align="center" valign="middle" >0.2338</td><td align="center" valign="middle" >0.2338</td><td align="center" valign="middle" >0.2338</td></tr><tr><td align="center" valign="middle" >(j)</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x105.png" xlink:type="simple"/></inline-formula> <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x106.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" >1</td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x107.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x108.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x109.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x110.png" xlink:type="simple"/></inline-formula></td><td align="center" valign="middle" ><inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/6-1720803x111.png" xlink:type="simple"/></inline-formula></td></tr></tbody></table></table-wrap><p>solved and the function is evaluated at some final value of the variable x f by the fourth-order RK (Runge-Kutta), ABM (Adams-Bashforth-Moulton), Milne, and the DTS algorithms, using a step size h = 0.1 in each case.</p><p>In <xref ref-type="table" rid="table1">Table 1</xref>, Equations (a)-(f) describe different types of oscillating systems. In each equation x is time and y represent an oscillating physical quantity. The first equation corresponds to a sinusoidally driven damped harmonic oscillator. The second equation is the general equation of a pendulum (simple or compound), oscillating with some (not necessarily small) amplitude. The third is the differential equation of an intrinsically nonlinear oscillator, consisting of a mass tethered by two springs, oscillating in a direction perpendicular to the springs. Equation (d) describes the motion of a Van der Pol oscillator [<xref ref-type="bibr" rid="scirp.74815-ref16">16</xref>] [<xref ref-type="bibr" rid="scirp.74815-ref17">17</xref>] . Equation (e) is the Duffing's equation with damping, describing the oscillations of an externally driven hacksaw blade clamped at one end [<xref ref-type="bibr" rid="scirp.74815-ref18">18</xref>] . Finally, (f) is the differential equation of motion of a particle oscillating under a Lennard-Jones (6-12) potential energy function [<xref ref-type="bibr" rid="scirp.74815-ref19">19</xref>] . In each case, the final time x f at which the function is evaluated numerically, is chosen such that the oscillator undergoes approximately one-half cycle. The last column gives the “true” value of the function at x f , evaluated either by analytical solution of the differential equation when available, or by a very small step size ( h = 0.001 ), using the fourth-order RK algorithm.</p><p>Equations (g)-(j) are some of the common linear differential equations of mathematical physics, namely, Bessel, Legendre, Laguerre, and Hermite, res- pectively [<xref ref-type="bibr" rid="scirp.74815-ref20">20</xref>] . They show up in a variety of physical problems, ranging from heat conduction in solids, to wave equations, to quantum mechanical systems.</p><p>In all cases studied, the DTS algorithm generated a noticeably shorter CPU time than any other algorithm. In fact, the average CPU time for the DTS programs was found to be 21%, 58%, and 68% shorter than those for the cor- responding RK, Milne and ABM programs, respectively.</p></sec><sec id="s4"><title>4. Discussion</title><p>Based on the results listed in <xref ref-type="table" rid="table1">Table 1</xref>, we see that in all cases studied the DTS (direct Taylor series) method provides accuracies that are essentially identical to the widely used algorithms of the same order while requiring a shorter computation time.</p><p>Evaluation of higher derivatives does not pose any serious difficulty. Indeed, higher derivatives become less problematic for differential equations of higher order. For example, with the fourth-order DTS algorithm and a second-order differential equation, only two higher derivatives should be computed from the differential equation; for a fourth-order equation, no higher-order derivatives are needed.</p><p>A striking feature of the DTS method is the ease with which its order of accuracy can be increased. For instance, to increase the order of the algorithm from four to six, one only needs to retain two additional terms in the Taylor expansion. Such an increase of the order of algorithm is not a trivial task in the RK (Runge-Kutta), ABM (Adams-Bashforth-Moulton), or Milne method. Simi- larly, while generalizations of the latter methods to higher-order differential equations are not trivial, in the former case, it can be accomplished by simply incorporating Taylor expansions for higher derivatives, as we shall demonstrate in the following paragraph.</p><p>Third-order differential equations are not common in physics and engi- neering. Fourth-order equations, on the other hand, are occasionally encoun- tered in some cases, such as bending of beams. As an example, we demonstrate the power of the DTS algorithm for the following simple fourth-order linear differential equation for which the analytical solution exits for comparison,</p><p>4 d 4 y d x 4 − 5 d 2 y d x 2 + y = 0 (13)</p><p>subject to the initial conditions</p><p>y ( 0 ) = 1 ,   y ( 1 ) ( 0 ) = 1 2 ,   y ( 2 ) ( 0 ) = 1 ,   y ( 3 ) ( 0 ) = 1 8 (14)</p><p>With a step size h = 0.1 , the fourth-order DTS method yields y ( 1 ) = 2.0637 . With the sixth-order algorithm and the same step size, we find y ( 1 ) = 2.0641757 . These compare with the true value of 2.0641759, obtained from the analytical solution of the differential equation,</p><p>y = cosh x + sinh x 2 (15)</p><p>The discrepancies between the true and the numerical values in the two cases are, respectively, of the order h 4 and h 6 , as they should be.</p></sec><sec id="s5"><title>5. Conclusion</title><p>In conclusion, we see that the direct Taylor series (DTS) algorithm is simple, easy to use, accurate, extendable to higher accuracies by simply retaining higher- order terms in Taylor expansions while requiring noticeably less computation time. Higher-order differential equations can be solved by trivial inclusion of Taylor expansions of higher derivatives. The other algorithms, such as Runge- Kutta, Adams-Bashforth-Moulton, and Milne methods are elegant but require complete construction of their working equations, which can be quite tedious depending on the order of the algorithm.</p></sec><sec id="s6"><title>Acknowledgements</title><p>This work was supported by a URAP grant from the University of Wisconsin- Parkside.</p></sec><sec id="s7"><title>Cite this paper</title><p>Mohazzabi, P. and Becker, J.L. (2017) Numerical Solution of Differential Equations by Direct Taylor Ex- pansion. Journal of Applied Mathematics and Physics, 5, 623-630. https://doi.org/10.4236/jamp.2017.53053</p></sec></body><back><ref-list><title>References</title><ref id="scirp.74815-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Press, W.H., Teukolsky, S.A., Vetterling, W.T. and Flannery, B.P. (1992) Numerical Recipes in Fortran. 2nd Edition, Cambridge University Press, Cambridge, Chapter 16.</mixed-citation></ref><ref id="scirp.74815-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Brauer, F. and Nohel, J.A. (1967) Ordinary Differential Equations. Benjamin, New York, Chapter 8.</mixed-citation></ref><ref id="scirp.74815-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Carnahan, B., Luther, H.A. and Wilkes, J.O. (1969) Applied Numerical Methods. Wiley, New York, Chapter 6.</mixed-citation></ref><ref id="scirp.74815-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Gould, H. and Tobochnik, J. (1996) An Introduction to Computer Simulation Methods. 2nd Edition, Addison-Wesley, Read-ing, 120-126.</mixed-citation></ref><ref id="scirp.74815-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Agnew, R.P. (1960) Differential Equations. 2nd Edition, McGraw-Hill, New York, Chapter 8.</mixed-citation></ref><ref id="scirp.74815-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Golomb, M. and Shanks, M. (1965) Elements of Ordinary Differential Equations. 2nd Edition, McGraw-Hill, New York, 18-33.</mixed-citation></ref><ref id="scirp.74815-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Tenenbaum, M. and Pollard, H. (1963) Ordinary Differential Equations. Dover, New York, Chapter 10.</mixed-citation></ref><ref id="scirp.74815-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Betz, H., Burcham, P.B. and Ewing, G.M. (1964) Differential Equations with Applications. 2nd Edition, Harper and Row, New York, 254-261.</mixed-citation></ref><ref id="scirp.74815-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Ordinary Differential Equations of Higher Order Can Always Be Reduced to a Set of First-Order Differential Equations (See, for Example, Reference [1]).</mixed-citation></ref><ref id="scirp.74815-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">An Algorithm Is Called n-th Order if the Global Error Is of the Order of hn.</mixed-citation></ref><ref id="scirp.74815-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Arfken, G. (1985) Mathematical Methods for Physicists. 3rd Edition, Academic Press, San Diego, 491-492.</mixed-citation></ref><ref id="scirp.74815-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Gear, C.W. (1971) Numerical Initial Value Problems in Ordinary Differential Equation. Prentice-Hall, Englewood Cliffs, Chapter 2.</mixed-citation></ref><ref id="scirp.74815-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Lapidus, L. and Seinfeld, J.H. (1971) Numerical Solution of Ordinary Differential Equations. Academic Press, New York, Chapter 2.</mixed-citation></ref><ref id="scirp.74815-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Boyce, W.E. and DiPrima, R.C. (1967) Elementary Differential Equations and Boundary Value Problems. Wiley, New York, 286-321.</mixed-citation></ref><ref id="scirp.74815-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Rainville, E.D. and Bedient, P.E. (1981) Elementary Differential Equations. 6th Edition, Macmillan Publishing Company, New York, 409-411.</mixed-citation></ref><ref id="scirp.74815-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Fowles, G.R. and Cassiday, G.L. (1999) Analytical Mechanics. 6th Edition, Saunders, New York, 132.</mixed-citation></ref><ref id="scirp.74815-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Baierlein, R. (1983) Newtonian Mechanics. McGraw-Hill, New York, 88-93.</mixed-citation></ref><ref id="scirp.74815-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Ibid, 81-82.</mixed-citation></ref><ref id="scirp.74815-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Kittel, C. (1976) Introduction to Solid State Physics. 5th Edition, Wiley, New York, 81.</mixed-citation></ref><ref id="scirp.74815-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Lebedev, N.N. (1972) Special Functions and Their Applications. Translated and Edited by Silverman R.A., Dover, New York.</mixed-citation></ref></ref-list></back></article>