Calculus II Class 03/31
Find the Taylor series for f(x) = e^(x^2).
Hard way:
f(x) = e^(x^2)
f ' (x) = 2x e^(x^2)
f ''(x) = 4x^2 e^(x^2) + 2 e^(x^2)
f '''(x) = 8 x^3 e^(x^2) + 8 x e^(x^2) + 4 x e^(x^2)
etc..
f(0) = 1
f ' (0) = 0
f '' (0) = 2
f '''(0) = 0
etc. You figure out the rest of the pattern.
Easy way:
e^x = 1 + x + x^2 / 2! + x^3 / 3! + x^4 / 4 ! + ... + x^n / n! + ... so
e^(x^2) = 1 + x^2 + (x^2)^2 / 2! + (x^2)^3 / 3! + (x^2)^4 / 4 ! + ... + (x^2)^n / n! + ..
= 1 + x^2 + x^4 / 2! + x^6 / 3! + x^8 / / 4! + ... + x^(2n) / n! + ...
Recall that sin(x) = x - x^3 / 3! + x^5 / 5! - x^7 / 7! + ... and cos(x) = 1 - x^2 / 2! + x^4 / 4! - x^6 / 6! + ... .
What is cos(x^2 + 2x + 3)? Expand this thing term by term (i.e., start with just P2(x) = 1 - x^2 / 2!, then do P4(x) = 1 - x^2 / 2! + x^4 / 4! ... and express everything in powers of x)
For y = cos(x) we have
P2(x) = 1 - x^2 / 2! so our approximation to cos(x^2 + 2x + 3) is
P2(x^2 + 2x + 3) = 1 - (x^2 + 2 x + 3)^2 / 2!
= 1 - (x^4 + 4 x^3 + 10 x^2 + 12 x + 9) / 2!
= - 7/2 - 6 x - 5 x^2 - 2 x^3 - x^4 / 2.
P4(x^2 + 2x + 3) = 1 - (x^2 + 2 x + 3)^2 / 2! + (x^2 + 2 x + 3)^4 / 4!
= 1 - (x^4 + 4 x^3 + 10 x^2 + 12 x + 9) / 2! + (x^8 + 8·x^7 + 36·x^6 + 104·x^5 + 214·x^4 + 312·x^3 + 324·x^2 + 216·x + 81) / 4!
= (x^8 + 8·x^7 + 36·x^6 + 104·x^5 + 202·x^4 + 264·x^3 + 204·x^2 + 72·x - 3)/24
= -1/8 + 3 x + 26 / 3 x^2 + 11 x^3 + 101/12 x^4 + 13/3 x^5 + 3/2 x^6 + 1/3 x^7 + x^8 / 24
Find the derivative of the Taylor expansion for sin(x) (recall that sin(x) = x - x^3 / 3! + x^5 / 5! - x^7 / 7! + ...):
We simply take the derivative, term by term:
(sin(x)) ' = x - 3x^2 / 3! + 5 x^4 / 5! - 7 x^6 / 6! + ...
= x - 3x^2 / (3 * 2 * 1) + 5 x^4 / (5 * 4 * 3 * 2 * 1) - 7 x^6 / (7*6 * 5 * 4 * 3 * 2 * 1) + ...
= x - x^2 / (2*1) + x^4 / (4*3*2*1) - x^6 / (6*5*4*3*2*1)
= x - x^2 / 2! + x^4 / 4! - x^6 / 6! + ...
This is just the Taylor series for the cosine, which it better be since we just took the derivative of the Taylor series for the sine.
What is the series for f(x) = x^2 e^(x^2), which incidentally you will remember we can't seem to integrate using any of our techniques?
From before we recall that
e^(x^2) = 1 + x^2 + (x^2)^2 / 2! + (x^2)^3 / 3! + (x^2)^4 / 4 ! + ... + (x^2)^n / n! + ..
= 1 + x^2 + x^4 / 2! + x^6 / 3! + x^8 / / 4! + ... + x^(2n) / n! + ...
To get the series for x^2 e^(x^2) we just multiply the series for e^(x^2) by x^2:
x^2 * (1 + x^2 + x^4 / 2! + x^6 / 3! + x^8 / / 4! + ... + x^(2n) / n! + ...)
= x^2 + x^4 + x^6 / 2! + x^8 / 3! + x^10 / 4! + ... + x^(2n+2) / n! + ...
What is the series for the indefinite integral of x^2 e^(x^2)?
We find an antiderivative, term by term, as we would do for any polynomial. Since antiderivatives of x^2, x^4, x^6, x^8, x^10, and x^(2n +2) are respectively x^3/3, x^5/5, x^7/7, x^9/9, x^11/11 and x^(2n+3) / (2n+3) we get
antiderivative = x^3 / 3 + x^5 / 5 + (x^7 / 7) / 2! + (x^9/9) / 3! + (x^11/11) / 4! + ... + [ x^(2n+3) / (2n+3) ] / n! + ...
or including an integration constant c and simplifying
general antiderivative = c + x^3 / 3 + x^5 / 5 + x^7 / (7 * 2!) + x^9/(9*3!) + x^11/(11* 4!) + ... + x^(2n+3) / [ n! * (2n+3) ] + ...
What is the interval of convergence of this sequence?
Find limit{n -> infinity} [ a(n+1) / a(n) ] . Interval of convergence is the reciprocal of this limit.
Recall the nth degree Taylor polynomial, obtained by matching at x = 0 the first n derivatives of f(x) with the first n derivatives of a degree-n polynomial:
Pn(x) = f(0) + f ' (0) * x + f '' (0) * x^2 / 2!
+ f '''(0) * x^3 / 3! + f ''''(0) * x^4 / 4! + ... + f[n] * x^n / n!
We saw that as n increases, Pn(x) 'works' for greater and greater intervals around x = 0.
If we extend this series so it goes forever, then if f is continuously differentiable to all degrees the result converges for every x inside the interval of convergence to f(x) and we say that
f(x) = f(0) + f ' (0) * x + f '' (0) * x^2 / 2! + f '''(0) * x^3 / 3! + f ''''(0) * x^4 / 4! + ... + f[n] * x^n / n! + ...
The Taylor polynomials Pn(x) were approximations. This series is the real thing--it converges to f(x) for every x within the radius of convergence.
The Taylor series can be written down if we can find an expression for f[n](x), the nth derivative of f(x), for arbitrary n.
This usually involves looking at the pattern of successive derivatives.
We saw for example that the successive derivatives of y = sin(x) were
The repeating pattern is clear. We also easily see that at x = 0 the function and derivatives are
etc., repeating in the pattern 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, ... .
Let's look at the pattern of derivatives for y = e^x.
We see very quickly that
At x = 0,
So the Taylor Series f(x) = f(0) + f ' (0) * x + f '' (0) * x^2 / 2! + f '''(0) * x^3 / 3! + f ''''(0) * x^4 / 4! + ... + f[n] * x^n / n! + ... becomes
or
The figure below shows the graph of y = e^x along with the graph of the first two terms 1 + x of the expansion.
The next figure shows the preceding graphs in addition to the graph of the first three terms 1 + x + x^2 / 2! of the expansion.
The next figure adds the graph of the first four terms 1 + x + x^2 / 2! + x^3 / 3!of the expansion.
This series of figures demonstrates the convergence of the Taylor series to the exponential function, at least over the range demonstrated here.
Now look at f(x) = ln(x). We first consider the sequence of its successive derivatives:
The pattern of the derivatives is an alternating sign (+ then 1 then + then 1 etc.), with the factorial being of the number which is one less than the derivative (e.g., 2! for 3d derivative, 3! for 4th dreivative, etc.).
We speculate that the nth derivative is something like
But this doesn't quite work. For n = 2 this gives us f ''(x) = (-1)^2 * (2-1)! / x^2 = 1 / x^2, not -1 / x^2. This formula will give us negative values for odd n, and positive values for even n.
How can we adjust the formula?
Suggestion: Divide by -1 to switch all the signs.
Comment: That will do it. So will multiplication by -1.
Note that if we multiply (-1)^n * (n-1)! / x^n by -1 we get
which since -1 * (-1)^n = (-1)^(n+1) simplifies to
We can't use x = 0 with this sequence of derivatives, since every derivative has a power of x in the denominator.
So we shift everything 1 unit to the right, replacing x by x - 1 to obtain
f(x) = f(1) + f ' (1) * (x-1) + f ''(1) * (x-1)^2 / 2! + f '''(1) * (x-1)^3 / 3! + ... + (-1)^(n+1)* (n-1)! (x-1)^n / n! + ... .
A summary is found in the figure below:
Our values of f and its derivatives at x = 1 are
and in general, since (n-1)! / n! = (n-1)(n-2)(n-3) ... 1 / [ n (n-1) (n-2) (n-3) ... 1 ] = 1 / n,
So we have
f(x) = ln(x)
= 0 + 1 * (x-1) + -1 * (x-1)^2 / 2! + (2) * (x-1)^3 / 3! + (-3!) * (x-1)^3 / 4! + ... + (-1)^(n+1)* (x-1)^n / n + ...
= (x-1) - (x-1)^2 / 2 + (x-1)^3 / 3 - (x-1)^4 / 4 + (x-1)^5 / 5 ... + (-1)^(n+1)* (x-1)^n / n + ...
This is summarized below:
To find the interval of convergence of this sequence we look at limiting value of a(n+1) / a(n).
Thus
The limiting value of this ratio is therefore
It follows that the series (x-1) - (x-1)^2 / 2 + (x-1)^3 / 3 - (x-1)^4 / 4 + (x-1)^5 / 5 ... + (-1)^(n+1)* (x-1)^n / n + ... converges to ln(x) for | x1 | < 1, or 0 < x < 2.
The figure below shows graphs of y = ln(x) and the first-degree Taylor polynomial approximation y = x - 1.
The figure below shows the preceding graphs and the graph of the second-degree Taylor polynomial approximation y = x - 1 - (x - 1)^2 / 2.
The figure below shows the graphs of y = ln(x) and the graphs of the first- through tenth-degree Taylor polynomial approximations.
The binomial theorem can be proved by performing a Taylor expansion of y = (1 + x )^p at x = 0.
The derivatives of y = (1 + x)^p are
At x = 0 we get y = 1, y ' = p, y '' = p(p-1), y ''' = p (p-1) (p-2), etc.. The n+1 derivative of y = (1 + x ) ^ p is zero, since (1 + x ) ^ p is a polynomial of degree p.
The Taylor expansion of (1 + x ) ^ p is therefore
We note that p ( p-1) ( p-2) ... ( p - n + 1 ) / n! = C(p, n), the number of combinations of n objects chosen from among p.