Taylor series - Solutions. f(x) sin(x) sin(0) + x cos(0) + x x ( sin(0)) +!! ( cos(0)) + + x4 x5 (sin(0)) + 4! 5! 0 + x + 0 x x! + x5 5! x! + 0 + x5 (cos(0)) + x6 6! ( sin(0)) + x 7 7! + x9 9! 5! + 0 + x! + X ( ) n x n+ (n + )! Convergence a n n! a n ( ) n x n+ (n )! n! (n + )! ( ) n x n ( ) x n! (n + ) (n) 0 for all x Interval of convergence is thus < x < f(x) cos(x) cos(0) + x ( sin(0)) + x x ( cos(0)) +!! sin(0) + + x4 x5 x6 (cos(0)) + ( sin(0)) + 4! 5! 6! ( cos(0)) + x + 0! + 0 + x4 x 6 0 4! 6! + x! + x4 4! x 6 6! + x8 8! x 0 0! + X ( ) n x n (n)! Convergence a n n! a n ( ) n x n (n )! n! (n)! ( ) n x n ( ) x n! (n) (n ) 0 for all x Interval of convergence is thus < x <
. cosh(x) ex + e x + x + x + x!! + x! + x4 4! + x! + x4 4! + x6 6! + X x n (n)! ( x) + + + ( x) +! + + ( x)! + Convergence a n n! x n n! (n)! a n (n )! x n So interval of convergence is < x < x n! (n)(n ) 0 for all x sinh(x) ex e x + x + x! + x! + ( x) ( x)! x + x + x5 +! 5! + x! + x5 5! + x7 7! + X x n+ (n + )! ( x)! + Convergence a n n! x n+ n! (n + )! a n (n )! x n So interval of convergence is < x < x n! (n + )(n) 0 for all x
. and so f () (x) f (4) (x) + x f () (x) 6 ( + x) 4 f (5) (x) ( + x) f () (x) 4 ( + x) 5 etc. ( + x) f () (0) f () (0) f () (0) f (4) (0) 6 f (5) (0) 4 etc. So for n > we see that Now we have f (n) (0) ( ) n+ (n )! X (x 0) n f (n) (0) f(x) n! (x 0)0 f (0) (0) X + 0! n (x 0) n f (n) (0) n! where we have explicitly written the rst term (n 0) So for f(x) ln( + x) we have ln( + x) (x 0)0 ln( + 0) X x n ( ) n+ (n )! + 0! n! n X x n ( ) n+ 0 + n Convergence n! a n a n x n x + x x 4 4 + x n ( ) n+ n n! n x n ( ) n x(n ) n! n x x jxj n! n For convergence we require that n! a n a n < and so we require jxj < Interval of convergence is thus < x <
4. sin 5! + 7 9 5! 7! + 9! 0470 0940 + 00049 00007 + 0000006 08660 ( 08660 using calculator directly) 5. We rst evaluate ln (07) 07 because (07) 07 exp ln (07) 07 and we know how to expand ln( + x) and e x 6. ln (07) 07 07 ln 07 07 ln( 0) 07 ln ( + ( 0)) ( ) ( 0) 07 0 + ( 0) ( 0) 4 + ( 0)5 4 5 Now 07 f 0 004500 000900 0000 000049g 07 f 0565g 04956 (07) 07 exp ln (07) 07 e 04956 + ( 04956) + ( 04956) + ( 04956) 6 04956 + 004 00059 + 00006 07795 ( 077906 using calculator directly) ln() ln( + 0) (0) 0 + (0) (0) 4 + (0)5 4 5 0 004500 + 000900 0000 + 000049 + ( 04956)4 4 0646 ( 066 using caclulator directly)
7. ln(0000) ln( 09998) ln ( + ( 09998)) ( 09998) 09998 + ( 09998) ( 09998) 4 4 09998 049980 0 04980 09980 8 8579 using calculator directly!!! + ( 09998)5 5 We may resolve this problem by writing 0.000 in a di erent manner ln(0000) ln ln ln 0 4 ln 4 ln 0 0000 ln 4 ln 5 ln 4 ( ln + ln 5) ln ln 4 ln 5 ln 4 ln 5 Now ln 4 ln ln(5) + ln() ln( + 05) + ln( + 0) (05) ln( + 05) 05 + (05) (05) 4 + (05)5 4 5 05 0500 + 00467 0056 + 00065 04079 ( 040547 using calculator directly) ln( + 0) 0 005555 + 005 00009 + 00008 08786 ( 08768 using calculator directly). Thus we have ln 04079 + 08786 06955 ( 0695 using calculator directly).
Also (05) ln(5) ln( + 05) 05 + (05) (05) 4 4 05 005 + 0005 000098 + 00000 08 ( 04 using calculator directly). + (05)5 5 Thus we have ln(0000) ln 4 ln 5 (06955) 4(08) 8597 ( 8579 using calculator directly) 8. (a) For x we calculate ln( + ) + 4 + X j0 ( ) j j + X a j j0 We seek the smallest value of j for which ja j j < 0 Thus we require ( ) j j + < 0 ) j > 999 i.e. we need the terms j 0; ; ; 000. So the answer is 00 terms. (b) For x we calculate ln X j j j Thus we require j j < 0 ) j > 8 We nd the bound for j empirically, i.e. we tried,,,... until we found that 8 satis ed the inequality. Thus the answer is 8 terms.
(c) For x we calculate ln + + + 5! + 5 X j0 j+ j + Thus we require j+ j + < 0 ) j > We nd the bound for j empirically, i.e. we tried, and. Thus the answer is 4 terms. 9. We know that and consequently e x X j0 x j j! e x X ( x ) j j0 j! X ( ) j x j j0 j! x + x4 Let f(x) e x, thus we have j f (j) f (j) (0) 0 e x xe x 0 e x + 4x e x xe x 8x e x 0 4 e x 48x e x + 6x 4 e x.. Thus we nd e x + 0x. x! + 0x! + x4 4! + x + x4 + and the two expansions are identical in the rst three terms.
0. We have erf(x) Z x p e t dt 0 p Z x X ( ) j t j dt X p 0 j! j0 j0 p X ( ) j t j+ x (j + )(j!) j0 p X ( ) j x j+ (j + )(j!) j0 p x 0 x (!) + x5 5(!) Z x 0 x 7 7(!) + ( ) j t j dt j! Consequently erf() p + 0 4 + Summing the rst four terms yields 0.88. Thus we have an approximate error of j0847 088j 00045.. Using f(x) cos x we tabulate j f (j) f (j) () 0 cos x sin x 0 cos x sin x 0 4 cos x 5 sin x 0 6 cos x 7 sin x 0 where we see a repeating pattern. We have f (j) 0; j k + ; k Z () ( ) k ; j k; k Z
Consequently the Taylor series is given by X (x ) j f(x) f (j) () j! cos x j0 X ( ) k (x ) k (k)! k0 Note the similarity with the series around 0 X ( ) k x k cos x (k)! k0 Shifting x by causes a change in sign for cos x from For convergence we identify the term so that a k+ a k cos x cos( x) cos(x ) a k ( )k (x ) k (k)! ( ) k+ (x ) (k+) (k)! ((k + ))! ( ) k (x ) k (x ) (k + )(k + ) Thus a k+ k! a k 0 < 8x ( ; ) and so the interval of convergence is ( ; ).. We know that sin x X j0 ( ) j x j+ (j + )! and consequently sin x X ( ) j (x ) j+ (j + )! X ( ) j x 4j+ (j + )! x 6 x 6 + x0 0 j0 j0 x 4 5040 +
We identify in the term sin x X j0 ( ) j x 4j+ (j + )! a j ( ) j x 4j+ (j + )! and applying the convergence criteria a j+ j! a j < where a j+ a j ( ) j+ x 4j+6 (j + )! yields ( )j (j + )! x 4j+ a j+ j! a j 0 < x 4 (j + )(j + ) for all x ( ; ). Thus convergence holds for all real x.. Using sin x x x6 6 yields in the equation x x 6 x ( 6 0 x 4 6 ) 0 with solutions x 0 and x 4 6 (i.e x p p 6 565). Obviously sin (x ) 0 implies x k for k N 0. In other words x p k. The approximation p p p 6 is near the root with k with x 77. Thus the approximation error j p q p6j 007 is not very small. Attempting to improve the approximation sin x x x 6 6 + x0 0 0
yields the equation x x 4 ( 6 + x8 0 ) 0 which has roots x 0 and (x 4 ) 0(x 4 ) + 0 0. This last equation for the non-zero roots has no real roots for x 4 0 p 400 480 Thus adding terms to the Taylor series approximation does not always yield better results (in this case no solution at all). Interestingly, though, expanding to an order 4 approximation yields good results. 4. We have so that sin x sin x x when x 6 0. It follows that X j0 ( ) j x j+ (j + )! X ( ) j x j (j + )! j0 sin x x!0 x x!0 x X j0 ( ) j x j+ (j + )! X ( x j+ x!0 )j x(j + )! X ( x j x!0 )j (j + )! X j0 j0 ( ) 0 (x0 ) + x!0! + j X ( ) j 0 j ( x j x!0 )j (j + )! where x!0 (x 0 ).
5. Using the expansion sin x X j0 ( ) j x j+ (j + )! yields so that (sin x) X j0 (sin x)! ( ) j x j+ (j + )! X X j0 k0 X k0! ( ) k x k+ (k + )! ( ) j+k x (j+k+) (j + )!(k + )! To nd the expansion we would have to determine the coe cient of x 0 (which is zero), x (for j k 0), x 4 (for j 0; k and j ; k 0), x 6 (for j 0; k, j ; k and j ; k 0) and so on. Obviously for higher degree in x n we have more terms to sum for the di erent j and k such that (j + k + ) n. () Obviously we can determine the Taylor series expansion directly d 0 dx 0 sin x sin x d dx sin x sin x cos x sin x d dx sin x cos x d dx sin x 4 sin x d 4 dx 4 sin x 8 cos x. Generally, we have d n dx n sin x 8 < sin x n 0 ( ) k k sin x n k + ; k 0; ; ; ( ) k k cos x n k; k ; ; ;
Consequently 8 d n < 0 n 0 dx n sin x 0 n k + ; k 0; ; ; x0 ( ) k k n k; k ; ; ; Thus the Taylor expansion follows X sin x j d j X x j! dx j sin x ( ) k k x k x0 (k)! j0 where ( ) k ( ) k+. k X ( ) k+ (x) k k (k)! () Since sin x ( cos x) we can use the Taylor expansion of cos x to obtain sin x cos x X j0 ( ) j xj (j)! X j0 ( ) j (x)j (j)! X j X ( ) j+ (x) j (j)! j! ( ) j (x)j (j)!! 6. We have so that d n ( ) k dx sin x sin x n k; k Z n ( ) k cos x n k + ; k Z d n dx sin x n 6 Suppose we seek accuracy ", then we require jr n j < where x n+ d n+ jr n j sin x (n + )! dxn+ x n+ d n+ (n + )! sin x dxn+ x x 6 x n+ (n + )!
where (0; x) or (x; 0) depending on whether x is positive or negative. Thus it is su cient (but not necessary) to require that x n+ (n + )! < " which is equivalent to jxj n+ < "(n + )! The value of n satisfying the inequality depends on x. For x 4 and " 0 5 we nd (empirically) the smallest n satisfying the inequality is 7. For x and " 0 5 we nd (empirically) the smallest n satisfying the inequality is 5. 7. Using the Taylor expansion of cos x and sin x we set cos x X ( ) j xj (j)! X ( ) j x j+ (j + )! sin x j0 j0 and truncating after x yields the approximation which results in a quadratic equation x x x + x 0 This equation has two solutions x p and x p. However, x p yields cos( p ) 09705 6 sin( p ) 09889 which di er by more than 05. The second solution yields cos( p ) 074805 6 sin( p ) 06689644
which di er by less than 0076. Consequently p gives a rst approximation for a solution (there are in nitely many). To obtain a more accurate solution we could apply root nding techniques using p as a starting point. Note that a solution to cos x sin x is x 4 and ( p ) 0055 4 so that p approximate a root with accuracy better than 0. ( p approximates 4 with accuracy (0; 04) and could also be used as a starting point for root nding, but obviously appears to be a worse candidate than p.) 8. Now, e sinh x x e x 4 ex + e x e x + e x X (x) n X ( x) n + n! n! X (x) n + ( x)n n! n! X (x) n + ( )n (x) n n! n! 0 n odd (x) n n even n! j+ x j (j)! where j 0; ; ; We replace the index n with j becasue j is always even, and the only nonzero term in the series are those with even index.
9. Hence, we have and so e x + e x X j0 + 4 ex + e x 4 4 X j X j j+ x j (j)! X j + X j j+ x j (j)! X j j+ x j (j)! j+ x j (j)! j x j (j)! j+ x j (j)! Interval of convergence a j+ j+ a j x j+ (j)! x (j + )! j x j (j + ) (j + ) which tends to zero as j! for all x Hence, the interval of convergence is ( ; ) f(x) cos(x + ) cos() + x ( sin()) + x x ( cos()) +!! sin() + + x4 x5 x6 (cos()) + ( sin()) + 4! 5! 6! ( cos()) + + 0 + x! + 0 x 4 4! + 0 + x6 6! + x 4 + x! 4! + x6 6! X ( ) n+ x n (n)! x 8 8! + x0 0! + X ( ) n x n cos (x) (n)!!
0. Of course, we have p 08 (08) 05 We rst evaluate ln (08) 05 because (08) 05 exp ln (08) 05 and we know how to expand ln( + x) and e x ln (08) 05 05 ln 08 05 ln( 0) 05 ln ( + ( 0)) ( ) ( 0) 05 0 + ( 0) ( 0) 4 4 05 f 0 00 000667 00004g 05 f 0067g 05 Now (08) 05 exp ln (08) 05 e 05 + ( 05) + ( 05) + ( 05) 6 05 + 00069 0000 0894455 ( 089447 using calculator directly)