Solving Differential Equations and Nonelementary Integrals
Learning Outcomes
Use Taylor series to solve differential equations
Use Taylor series to evaluate nonelementary integrals
Solving Differential Equations with Power Series
Consider the differential equation
[latex]{y}^{\prime }\left(x\right)=y[/latex].
Recall that this is a first-order separable equation and its solution is [latex]y=C{e}^{x}[/latex]. This equation is easily solved using techniques discussed earlier in the text. For most differential equations, however, we do not yet have analytical tools to solve them. Power series are an extremely useful tool for solving many types of differential equations. In this technique, we look for a solution of the form [latex]y=\displaystyle\sum _{n=0}^{\infty }{c}_{n}{x}^{n}[/latex] and determine what the coefficients would need to be. In the next example, we consider an initial-value problem involving [latex]{y}^{\prime }=y[/latex] to illustrate the technique.
Example: Power Series Solution of a Differential Equation
Use power series to solve the initial-value problem
Using [link] on the uniqueness of power series representations, we know that these series can only be equal if their coefficients are equal. Therefore,
we find that [latex]{c}_{0}=3[/latex]. We are now ready to solve for the rest of the coefficients. Using the fact that [latex]{c}_{0}=3[/latex], we have
Use power series to solve [latex]{y}^{\prime }=2y,y\left(0\right)=5[/latex].
Hint
The equations for the first several coefficients [latex]{c}_{n}[/latex] will satisfy [latex]{c}_{0}=2{c}_{1},{c}_{1}=2\cdot 2{c}_{2},{c}_{2}=2\cdot 3{c}_{3}[/latex]. In general, for all [latex]n\ge 0,{c}_{n}=2\left(n+1\right){C}_{n+1}[/latex].
Show Solution
[latex]y=5{e}^{2x}[/latex]
We now consider an example involving a differential equation that we cannot solve using previously discussed methods. This differential equation
[latex]{y}^{\prime }-xy=0[/latex]
is known as Airy’s equation. It has many applications in mathematical physics, such as modeling the diffraction of light. Here we show how to solve it using power series.
Example: Power Series Solution of Airy’s Equation
Use power series to solve
[latex]y^{\prime\prime}-xy=0[/latex]
with the initial conditions [latex]y\left(0\right)=a[/latex] and [latex]y^{\prime} \left(0\right)=b[/latex].
More generally, for [latex]n\ge 3[/latex], we have [latex]n\cdot \left(n - 1\right){c}_{n}={c}_{n - 3}[/latex]. In fact, all coefficients can be written in terms of [latex]{c}_{0}[/latex] and [latex]{c}_{1}[/latex]. To see this, first note that [latex]{c}_{2}=0[/latex]. Then
The initial condition [latex]y\left(0\right)=a[/latex] implies [latex]{c}_{0}=a[/latex]. Differentiating this series term by term and using the fact that [latex]{y}^{\prime }\left(0\right)=b[/latex], we conclude that [latex]{c}_{1}=b[/latex]. Therefore, the solution of this initial-value problem is
Use power series to solve [latex]y^{\prime\prime}+{x}^{2}y=0[/latex] with the initial condition [latex]y\left(0\right)=a[/latex] and [latex]{y}^{\prime }\left(0\right)=b[/latex].
Hint
The coefficients satisfy [latex]{c}_{0}=a,{c}_{1}=b,{c}_{2}=0,{c}_{3}=0[/latex], and for [latex]n\ge 4,n\left(n - 1\right){c}_{n}=-c_{n - 4}[/latex].
Solving differential equations is one common application of power series. We now turn to a second application. We show how power series can be used to evaluate integrals involving functions whose antiderivatives cannot be expressed using elementary functions.
One integral that arises often in applications in probability theory is [latex]\displaystyle\int {e}^{\text{-}{x}^{2}}dx[/latex]. Unfortunately, the antiderivative of the integrand [latex]{e}^{\text{-}{x}^{2}}[/latex] is not an elementary function. By elementary function, we mean a function that can be written using a finite number of algebraic combinations or compositions of exponential, logarithmic, trigonometric, or power functions. We remark that the term “elementary function” is not synonymous with noncomplicated function. For example, the function [latex]f\left(x\right)=\sqrt{{x}^{2}-3x}+{e}^{{x}^{3}}-\sin\left(5x+4\right)[/latex] is an elementary function, although not a particularly simple-looking function. Any integral of the form [latex]\displaystyle\int f\left(x\right)dx[/latex] where the antiderivative of [latex]f[/latex] cannot be written as an elementary function is considered a nonelementary integral.
Nonelementary integrals cannot be evaluated using the basic integration techniques discussed earlier. One way to evaluate such integrals is by expressing the integrand as a power series and integrating term by term. We demonstrate this technique by considering [latex]\displaystyle\int {e}^{\text{-}{x}^{2}}dx[/latex].
Example: Using Taylor Series to Evaluate a Definite Integral
Express [latex]\displaystyle\int {e}^{\text{-}{x}^{2}}dx[/latex] as an infinite series.
Evaluate [latex]{\displaystyle\int }_{0}^{1}{e}^{\text{-}{x}^{2}}dx[/latex] to within an error of [latex]0.01[/latex].
Show Solution
The Maclaurin series for [latex]{e}^{\text{-}{x}^{2}}[/latex] is given by
The sum of the first four terms is approximately [latex]0.74[/latex]. By the alternating series test, this estimate is accurate to within an error of less than [latex]\frac{1}{216}\approx 0.0046296<0.01[/latex].
Watch the following video to see the worked solution to Example: Using Taylor Series to Evaluate a Definite Integral.
Express [latex]\displaystyle\int \cos\sqrt{x}dx[/latex] as an infinite series. Evaluate [latex]{\displaystyle\int }_{0}^{1}\cos\sqrt{x}dx[/latex] to within an error of [latex]0.01[/latex].
Hint
Use the series found in the example: Deriving Maclaurin Series from Known Series.
Show Solution
[latex]C+\displaystyle\sum _{n=1}^{\infty }{\left(-1\right)}^{n+1}\frac{{x}^{n}}{n\left(2n - 2\right)\text{!}}[/latex] The definite integral is approximately [latex]0.514[/latex] to within an error of [latex]0.01[/latex].
Try It
As mentioned above, the integral [latex]\displaystyle\int {e}^{\text{-}{x}^{2}}dx[/latex] arises often in probability theory. Specifically, it is used when studying data sets that are normally distributed, meaning the data values lie under a bell-shaped curve. For example, if a set of data values is normally distributed with mean [latex]\mu[/latex] and standard deviation [latex]\sigma[/latex], then the probability that a randomly chosen value lies between [latex]x=a[/latex] and [latex]x=b[/latex] is given by
To simplify this integral, we typically let [latex]z=\frac{x-\mu }{\sigma }[/latex]. This quantity [latex]z[/latex] is known as the [latex]z[/latex] score of a data value. With this simplification, integral our previous equation becomes
In the next example, we show how we can use this integral in calculating probabilities.
Example: Using Maclaurin Series to Approximate a Probability
Suppose a set of standardized test scores are normally distributed with mean [latex]\mu =100[/latex] and standard deviation [latex]\sigma =50[/latex]. Use the equation before this example and the first six terms in the Maclaurin series for [latex]{e}^{\frac{\text{-}{x}^{2}}{2}}[/latex] to approximate the probability that a randomly selected test score is between [latex]x=100[/latex] and [latex]x=200[/latex]. Use the alternating series test to determine how accurate your approximation is.
Show Solution
Since [latex]\mu =100,\sigma =50[/latex], and we are trying to determine the area under the curve from [latex]a=100[/latex] to [latex]b=200[/latex], the integral becomes
Using the first five terms, we estimate that the probability is approximately [latex]0.4922[/latex]. By the alternating series test, we see that this estimate is accurate to within
If you are familiar with probability theory, you may know that the probability that a data value is within two standard deviations of the mean is approximately [latex]95\%[/latex]. Here we calculated the probability that a data value is between the mean and two standard deviations above the mean, so the estimate should be around [latex]47.5\text{%}[/latex]. The estimate, combined with the bound on the accuracy, falls within this range.
try it
Use the first five terms of the Maclaurin series for [latex]{e}^{\text{-}\frac{{x}^{2}}{2}}[/latex] to estimate the probability that a randomly selected test score is between [latex]100[/latex] and [latex]150[/latex]. Use the alternating series test to determine the accuracy of this estimate.
Hint
Evaluate [latex]{\displaystyle\int }_{0}^{1}{e}^{\text{-}\frac{{z}^{2}}{2}}dz[/latex] using the first five terms of the Maclaurin series for [latex]{e}^{\text{-}\frac{{z}^{2}}{2}}[/latex].
Show Solution
The estimate is approximately [latex]0.3414[/latex]. This estimate is accurate to within [latex]0.0000094[/latex].
Another application in which a nonelementary integral arises involves the period of a pendulum. The integral is
An integral of this form is known as an elliptic integral of the first kind. Elliptic integrals originally arose when trying to calculate the arc length of an ellipse. We now show how to use power series to approximate this integral.
Example: Period of a Pendulum
The period of a pendulum is the time it takes for a pendulum to make one complete back-and-forth swing. For a pendulum with length [latex]L[/latex] that makes a maximum angle [latex]{\theta }_{\text{max}}[/latex] with the vertical, its period [latex]T[/latex] is given by
where [latex]g[/latex] is the acceleration due to gravity and [latex]k=\sin\left(\frac{{\theta }_{\text{max}}}{2}\right)[/latex] (see Figure 3). (We note that this formula for the period arises from a non-linearized model of a pendulum. In some cases, for simplification, a linearized model is used and [latex]\sin\theta[/latex] is approximated by [latex]\theta[/latex].) Use the binomial series
If [latex]{\theta }_{\text{max}}[/latex] is small, then [latex]k=\sin\left(\frac{{\theta }_{\text{max}}}{2}\right)[/latex] is small. We claim that when [latex]k[/latex] is small, this is a good estimate. To justify this claim, consider
Furthermore, it can be shown that each coefficient on the right-hand side is less than [latex]1[/latex] and, therefore, that this expression is bounded by
For larger values of [latex]{\theta }_{\text{max}}[/latex], we can approximate [latex]T[/latex] by using more terms in the integrand. By using the first two terms in the integral, we arrive at the estimate
The applications of Taylor series in this section are intended to highlight their importance. In general, Taylor series are useful because they allow us to represent known functions using polynomials, thus providing us a tool for approximating function values and estimating complicated integrals. In addition, they allow us to define new functions as power series, thus providing us with a powerful tool for solving differential equations.