Main /
## ComputingTaylorSeries< Taylor series | Home Page | Convergence > The previous module gave the definition of the Taylor series for an arbitrary function. It turns out that this is not always the easiest way to compute a function's Taylor series. Just as functions can be added, subtracted, multiplied, and composed, so can their corresponding Taylor series. Recall that the Taylor series for a function ($f$) is given by (:latex:) \[ f(x) = \sum_{k=0}^\infty \frac{f^{\left(k\right)}(0)}{k!} x^k = f(0) + f'(0)x + \frac{f''(0)}{2!} x^2 + \dotsb. \] (:latexend:) Using the definition of the Taylor series involves taking a lot of derivatives, which could be a lot of work, especially if the function involves compositions and products of functions, e.g. ($f(x) = \sin(x^2)e^{x^3}$). This module will show how to compute the Taylor series of such functions more easily by using the Taylor series for functions we already know. ## SubstitutionOur first method, substitution, allows us to plug one function into the Taylor series of another. Consider the function (:latex:) \[ f(x) = \frac{1}{x} \sin (x^2). \] (:latexend:) Computing the Taylor series for ($f$) from the definition would involve the quotient rule, chain rule, and a lot of algebra. But by taking the series for ($\sin x$) and substituting ($x^2$) into this series, and then distributing the ($\frac{1}{x}$), one finds (:latex:)
\begin{align*}
\frac{1}{x} \sin(x^2) &= \frac{1}{x} \left((x^2) - \frac{1}{3!}(x^2)^3 + \frac{1}{5!}(x^2)^5 - \dotsb \right) Note that getting this many terms using the definition would involve taking nine derivatives of the original function, which would be a lot of work! To get a more complete description of the Taylor series, one can use the summation notation, and again substitute to find (:latex:)
\begin{align*}
\frac{1}{x} \sin(x^2) &= \frac{1}{x} \sum_{k=0}^\infty (-1)^k \frac{(x^2)^{2k+1}}{(2k+1)!}
Recall the series for ($e^x$) is (:latex:) \[ e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \dotsb = \sum_{k=0}^\infty \frac{x^k}{k!} \] (:latexend:) Substituting ($x^3$) into the series for ($e^x$) gives (:latex:)
\begin{align*}
e^{x^3} &= 1 + x^3 + \frac{(x^3)^2}{2!} + \frac{(x^3)^3}{3!} + \dotsb ## Combining like termsAnother way to use previous knowledge of one Taylor series to find another is by combining like terms. This requires some careful algebra, but it is no more difficult than multiplying two polynomials together. For example, consider the function (:latex:) \[ f(x) = \cos^2(x) = \cos(x) \cdot \cos(x). \] (:latexend:) Finding the series for a function multiplied by another function is the same as taking the series for each function and multiplying them together, and then collecting like terms. This is where some algebra is required. (:latex:)
\begin{align*}
\cos(x) \cdot \cos(x) &= \left(1 - \frac{1}{2!}x^2 + \frac{1}{4!}x^4 - \dotsb \right)\left(1 - \frac{1}{2!}x^2 + \frac{1}{4!}x^4 - \dotsb \right) To see where the coefficient of ($x^4$) comes from, note that every ($x^4$) term comes from some term from the left series multiplied together with some term from the right series whose powers add up to 4. There are three such pairs: 1 on the left paired with ($\frac{1}{4!}x^4$) on the right; ($-\frac{1}{2!}x^2$) on the left paired with ($-\frac{1}{2!}x^2$) on the right; and ($\frac{1}{4!}x^4$) on the left paired with 1 on the right. This is the same algebra one would do when multiplying two polynomials together; this is just a way of collecting like terms in a systematic way.
(:latex:) \[ \cos^2 x = \frac{1+\cos(2x)}{2} \] (:latexend:) and substitution to find the series for ($\cos^2 x$). Try to give the series in summation notation (other than the first term). (:toggle hide show="Answer" box2:) By the above identity, (:latex:)
\begin{align*}
\cos^2x &= \frac{1}{2} \left(1 + \cos(2x)\right) In summation notation, (:latex:)
\begin{align*}
\cos^2x &= \frac{1}{2} \left(1 + \sum_{k=0}^\infty (-1)^k \frac{(2x)^{2k}}{(2k)!}\right) ## Hyperbolic trigonometric functionsThe hyperbolic trigonometric functions ($\sinh(x)$), ($\cosh(x)$), and ($\tanh(x)$) are defined by (:latex:)
\begin{align*}
\sinh(x) &= \frac{e^x - e^{-x}}{2} These hyperbolic trig functions, although graphically quite different from their traditional counterparts, have several similar algebraic properties, which is why they are so named. For example, the Pythagorean identity for cosine and sine has a version for hyperbolic cosine and sine: (:latex:) \[ \cosh^2(x) - \sinh^2(x) = 1. \] (:latexend:) One can verify this using the definitions and some algebra. But there is a geometric intuition for this relationship. Recall that cosine and sine give the ($x$) and ($y$) coordinates, respectively, for a point on the unit circle ($x^2+y^2 = 1$). The hyperbolic cosine and hyperbolic sine give the ($x$) and ($y$) coordinates, respectively, for points on the hyperbola ($x^2 - y^2 = 1$):
(:latex:)
\begin{align*}
\cosh(x) &= 1 + \frac{x^2}{2!} + \frac{x^4}{4!} + \dotsb = \sum_{k=0}^\infty \frac{x^{2k}}{(2k)!} Note that these are almost the same as the series for cosine and sine, respectively, except they do not alternate. This gives another reason for the names of these functions. (:toggle hide show="Answer" box3:) (:latex:)
\begin{align*}
\cosh(x) &= \frac{e^x + e^{-x}}{2} (:latex:)
\begin{align*}
\sinh(x) &= \frac{e^x - e^{-x}}{2} ## Manipulating Taylor seriesAnother way of using one Taylor series to find another is through differentiation and integration. For instance, to find the Taylor series for the derivative of ($f$), one can differentiate the Taylor series for ($f$) term by term.
(:latex:)
\begin{align*}
\frac{d}{dx} \sinh x &= \cosh x This is yet another relationship which is similar (though not identical) to the relationship between sine and cosine. (:toggle hide show="Answer" box4:) Differentiating hyperbolic sine gives (:latex:)
\begin{align*}
\frac{d}{dx} \sinh x &= \frac{d}{dx} \sum_{k=0}^\infty \frac{x^{2k+1}}{(2k+1)!} as desired. Similarly, differentiating hyperbolic cosine gives (:latex:) \begin{align*}
\frac{d}{dx} \cosh x &= \frac{d}{dx} \sum_{k=0}^\infty \frac{x^{2k}}{(2k)!} There was a little bit of reindexing there, but by writing out a few terms of each series, one can see that all of the above equalities are true. ## Higher Order Terms in Taylor SeriesIn some situations, it will be convenient only to write the first few terms of a Taylor series. This is particularly true when combining or composing more than one Taylor series. Up until now, an ellipsis has been used to indicate that there are more terms in the series that are being omitted. There is another way, sometimes used in this course, of notating the omitted terms in a Taylor series. That is by referring to them as Higher Order Terms (or H.O.T. for short). Having the extra HOT in a series means that all the remaining terms in the series have a higher degree than the previous terms.
(:latex:) \[ e^x = 1+x + \frac{1}{2!}x^2 + \hbox{ HOT}, \] (:latexend:) or it could also be written as (:latex:) \[ e^x = 1+x + \hbox{ HOT}. \] (:latexend:) The point at which the higher order terms are cut-off is somewhat arbitrary and depends on the situation. There is a more formal way of keeping track of the higher order terms, called Big-O notation, which is presented in orders of growth.
(:latex:) \[ f(x) = 1-2xe^{\sin x^2}. \] (:latexend:) (:toggle hide show="Answer" box5:) Beginning with the innermost function, in this case ($\sin x^2$), we find that (:latex:) \[ \sin x^2 = x^2 - \frac{1}{3!}(x^2)^3 + \hbox{ HOT} = x^2 - \frac{1}{6}x^6 + \hbox{ HOT}. \] (:latexend:) Then plugging this into the series for ($e^x$) gives
(:latex:)
\begin{align*}
e^{\sin x^2} &= 1 + \left(x^2 - \frac{1}{6}x^6 + \hbox{ HOT}\right) + \frac{1}{2!} \left(x^2 + \hbox{ HOT}\right)^2 + \frac{1}{3!} \left(x^2 + \hbox{ HOT} \right)^3 + \hbox{ HOT} Then to complete the answer, plug this into the original function to find (:latex:)
\begin{align*}
f(x) &= 1 - 2x \left( 1 + x^2 + \frac{1}{2}x^4 + \hbox{ HOT}\right) ## Extra examples
Compute the Taylor series (at 0) for ($\sin^2 x$) up to and including terms of order 6. Try to give the full Taylor series in summation notation. (:toggle hide show="Answer" box6:) (:latex:)
\begin{align*}
\sin^2 x &= (x-\frac{x^3}{3!}+\frac{x^5}{5!}-\dotsb)(x-\frac{x^3}{3!}+\frac{x^5}{5!}-\dotsb) To get the full Taylor series, one can use the identity (:latex:) \[ \sin^2 x = \frac{1-\cos(2x)}{2} \] (:latexend:) to find that (:latex:)
\begin{align*}
\sin^2 x &= \frac{1-\cos(2x)}{2}
Find the first three terms of the Taylor series for ($\sqrt{f(x)}$), where (:latex:) \[ f(x) = a_0 + a_1 x + a_2 x^2 + a_3x^3 + \dotsb. \] (:latexend:) (:toggle hide show="Answer" box7:) Let ($g(x) = \sqrt{f(x)}$), where (:latex:) \[ g(x) = b_0 + b_1 x + b_2 x^2 + b_3 x^3 + \dotsb. \] (:latexend:) Then ($g(x)^2 = f(x)$), and so the same holds for the Taylor series: (:latex:) \[ \left( b_0 + b_1 x + b_2 x^2 + b_3 x^3 + \dotsb \right)^2 = a_0 + a_1 x + a_2 x^2 + \dotsb. \] (:latexend:) Multiplying out and collecting like terms gives (:latex:) \[ b_0^2 + (b_0b_1 + b_1b_0) x + (b_0b_2 + b_1b_1 + b_2b_0) x^2 + \dotsb = a_0 + a_1 x + a_2 x^2 + \dotsb. \] (:latexend:) Now, equating coefficients of the monomials on the left and right gives the first few equations (of an infinite system of equations) (:latex:)
\begin{align*}
b_0^2 &= a_0 Solving these equations gives the first three coefficients of ($g$): (:latex:)
\begin{align*}
b_0 &= \sqrt{a_0} Thus, (:latex:) \[ \sqrt{a_0 + a_1 x + a_2 x^2 + \dotsb} = \sqrt{a_0} + \frac{a_1}{2\sqrt{a_0}} x + \frac{1}{2 \sqrt{a_0}} \left(a_2 - \frac{a_1^2}{4a_0} \right) x^2 + \dotsb. \] (:latexend:) ## EXERCISES- Compute the Taylor series of ($\cos(2x)\sin(3x)$) up to and including terms of degree 5. Don't try computing derivatives for this!
- Use a Taylor polynomial to give a cubic approximation to ($2xe^{3x}$)
- Compute the Taylor series of ($e^{1-\cos t}$) in summation notation.
- Compute the Taylor series of ($\cos(\sin(x))$) to fourth order.
- Compute the Taylor series of ($\sin(\cos(x))$) to forth order. What happens that makes this different than the last problem? (Hint: ($\cos(0)=1$) but ($\sin(0)=0$)...)
- Compute the first three nonvanishing terms in the Taylor series of ($e^{2x}(\sinh 3x)/x$).
- Compute the Taylor series of ($3x^2 e^{-x^2} \sin 2x^3$) up to and including terms of order eight (!) Wow, that means a lot of work, right? Think... which terms should you expand first?
- Compute the Taylor series of ($\frac{1}{x} e^{-x^2} \sinh(2x)$) up to the fourth order term.
- What is the second derivative of the function ($e^{x \cosh(x^2)}$) at ($x=0$)?
- Compute the following limit ($ \lim_{x \to 0} (1-e^x) \frac{\sin (x^2)}{x^3} $)
< Taylor series | Home Page | Convergence > |

Page last modified on September 20, 2016, at 10:45 AM