Instructor Hentzel Office Phone: 515-294-8141 E-mail: hentzel@iastate.edu Math Department Fax: 515-294-5454 http://www.math.iastate.edu/hentzel/class.166.03 Textbook: Calculus by Varberg, Purcell, Rigdon, eight edition. March 25 10.8 Taylor, Maclaurin p473:1-3,(6),7,(10),14,(17),18,(20),21-23,(28),32 Main Idea: The general term and the error function are the same. (n) (n+1) f (0) f (c) n+1 Key Words: -------- ----------- x n! (n+1)! Taylor Series, Maclaurin Series, Flat Functions Goal: Be able to express any function as a power series and compute an error bound. -------------------------------------------------------- Previous assignment: March 23 10.7 Term by term p466: (4),(7),11,(16),18,25 ,(33),35 Page 466 Problem 4 Find the power series representation for f(x) and specify the radius of convergence. x f(x) = ------------------- (1+x)^2 1 n n --- = 1 - x + x^2 - x^3 + x^4 + ... +(-1) x + ... 1+x -1 2 3 n n-1 ------- = -1 + 2x - 3x + 4x + ... + (-1) nx +.... 2 (1+x) x 2 3 4 n n ------- = x - 2x + 3x - 4x + ... - (-1) nx +.... 2 (1+x) The radius of convergence is 1. -------------------------------------------------- f[x_] := x/(1+x)^2; g[x_] := Sum[-(-1)^n n x^n,{n,1,10}]; a = Plot[f[x],{x,-0.8,2}]; b = Plot[f[x],{x,-3,-1.2}]; c = Plot[g[x],{x,-1.05,1.05},PlotStyle->{RGBColor[1,0,0]}]; d = Show[a,b,c,PlotLabel->"P466 P4 black = x/(1+x^2) red = SUM -(-1)^n n x^n"]; Display["4.ps",d]; ------------------------------------------------------------------------ Page 466 Problem 7 Find the power series representation for f(x) and specify the radius of convergence. 2 x f(x) = ----------- 4 1-x 1 2 3 n ----- = 1 + x + x + x + ... + x 1-x 1 4 8 12 4n ----- = 1 + x + x + x + ... + x 4 1-x 2 x 2 6 10 14 4n+2 ----- = x + x + x + x + ... + x + ... 4 1-x The radius of convergence is 1. -------------------------------------------------- f[x_] := (x^2)/(1-x^4); g[x_] := Sum[ x^(4n+2),{n,0,10}]; a = Plot[f[x],{x,-0.8,0.8}]; b = Plot[f[x],{x,-3,-1.2}]; c = Plot[f[x],{x,1.2,3}]; d = Plot[g[x],{x,-0.7, 0.7},PlotStyle->{RGBColor[1,0,0]}]; k = Show[a,b,c,d,PlotLabel->"P466 P7 black = (x^2)/(1-x^4) red = SUM x^(4n+2)"]; Display["7.ps",k]; ----------------------------------------------------- Page 466 Problem 16 Find the power series in x for the given function. 2 (x ) f[x] = x e x 2 3 4 n e = 1 + x + x /2! + x /3! + x /4! + ...... + x /n! + ... (x^2) 2 4 6 8 2n e = 1 + x + x /2! + x /3! + x /4! + ...... + x /n! + ... (x^2) 3 5 7 9 2n+1 xe = x + x + x /2! + x /3! + x /4! + ...... + x /n! + ... The radius of convergence is infinity because the radius of convergence x of e is infinity. -------------------------------------------------- f[x_] := x E^(x^2); g[x_] := Sum[ x^(2n+1)/n!,{n,0,10}]; a = Plot[f[x],{x,-2.0,2.0},PlotStyle->{Thickness[0.005]}]; b = Plot[g[x],{x,-2.0, 2.0},PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]; k = Show[b,a,PlotLabel->"P466 P7 black = x e^(x^2) red = SUM x^(2n+1)"]; Display["16.ps",k]; ----------------------------------------------------- Page 466 Problem 33 Let {fn} be the Fibonacci sequence defined by f = 0 f = 1 f = f + f . 0 1 n+2 n+1 n Infinity n If F(x) = SUM f x show that n=0 n 2 F(x) - x F(x) - x F(x) = x. Infinity n Infinity n+1 Infinity n+2 SUM f x - SUM f x - SUM f x n=0 n n=0 n n=0 n Infinity = f + f x + SUM f - f -f 0 1 n=2 n n-1 n-2 = x. Thus letting y = F(x) 2 y - xy - x y = x 2 y(1-x-x ) = x x -x A B y = ------------ = --------- = ----- + ----- 2 2 r-x s-x 1-x-x x +x-1 -Ax - Bx = -x As + Br = 0 -1 -1 0 r -r A = --------- = ------------ -1 -1 -r+s s r -1 -1 s 0 s B = ----------- = ----------- -1 -1 -r+s s r 1 -r s y = ------- ( ----- + -------) -r+s r-x s-x n n 1 -(1/r) + (1/s) Therefore fn = ----------- (-(1/r)^n + (1/s)^n ) = --------------- s-r s - r 1 1 2 1 3 2 4 3 5 5 6 8 7 13 8 21 9 34 10 55 ---------------------------------------------- s = (-1 + Sqrt[5])/2; r = (-1 - Sqrt[5])/2; f[n_] := 1/(s-r) (-r^(-n)+s^(-n)); Do[Print[n," ",Simplify[f[n]]],{n,1,10}]; ---------------------------------------------- =================================================== New Material Page 468 Example 1: Express Sin[x] as a power series. Find an upper bound on the error by using the 5 degree polynomial on [-Pi,Pi]. (6) Sin [c] 6 1 6 Error = ------- x <= ------- Pi = 1.33526 6! 6! 10 Pi ---- = 0.0258069 10! 20 Pi -9 --- = 3.60473 10 20! ----------------------------------------------------------- f[x_] := Sin[x]; g[x_,n_] := Sum[(-1)^i x^(2i+1)/(2i+1)!,{i,0,n}]; a = Plot[f[x],{x,-Pi, Pi},PlotStyle->{Thickness[0.005]}]; b = Plot[g[x, 0], {x,-Pi, Pi},PlotStyle->{RGBColor[1,0,0],Thickness[0.001]}]; c = Plot[g[x, 1],{x,-Pi, Pi},PlotStyle->{RGBColor[1,0,0],Thickness[0.001]}]; d = Plot[g[x, 2],{x,-Pi, Pi},PlotStyle->{RGBColor[1,0,0],Thickness[0.001]}]; e = Plot[g[x, 6],{x,-Pi, Pi},PlotStyle->{RGBColor[1,0,0],Thickness[0.001]}]; k = Show[a,b,c,d,e,PlotLabel->"black = Sin[x] red = SUM (-1)^n x^(2n+1)/(2n+1)!"]; Display["sin.ps",k]; ------------------------------------------------------------------------------- Page 470 Example 2: Express Cos[x] as a power series. How many terms are necessary so that the error on [-Pi/2,Pi/2] is less than 0.0001? (n+1) n+1 Cos [c] x error = ---------------------- (n+1)! ----------------------------------------------------- Do[Print[ n," ",N[(Pi/2)^(n+1)/(n+1)!]],{n,1,10}]; n error 1 1.2337 2 0.645964 3 0.25367 4 0.0796926 5 0.0208635 6 0.00468175 7 0.00091926 8 0.000160441 9 0.000025202 -6 10 3.59884 10 --------------------------------------------------- Page 470 Example 3: How many terms are necessary to approximate Cosh[x] to 0.00001 on [-2,2]. (n+1) n+1 Cosh (t) 2 error = ----------------------- (n+1)! Do[Print[ n," ",N[Cosh[2] 2^(n+1)/(n+1)!]],{n,1,12}]; 1 7.52439 2 5.01626 3 2.50813 4 1.00325 5 0.334417 6 0.0955478 7 0.023887 8 0.00530821 9 0.00106164 10 0.000193026 11 0.000032171 -6 12 4.94938 10 ------------------------------------------------------------- p Example 4: Express (1+x) as a power series. Memorize the following power series: 1 1. -------- 1-x 2. ln(1+x) 3. ArcTan[x] x 4. e 5. Sin[x] 6. Cos[x] 7. Sinh[x] 8. Cosh[x] p 9. (1+x) -1/x^2 10. Flat Functions: y = e