Practice Test 3 The real test is Monday, April 9. 1. (a) Write the power series for each of these. (b) Give the radius of convergence. (c) Give an error bound for truncating the series at degree 7 on the interval ( -1/2, 1/2 ). 1 (a) -------- 1-x 1 + x + x^2 + x^3 + .... + x^n + ... R = 1 8 8 x (1/2) 7 Error = ------------ <= --------- = (1/2) = 0.0078125 1-x 1-1/2 ----------------------------------------------------------------------- Get["font.math"]; a = Plot[1/(1-x),{x,-1,0.9},PlotStyle->{RGBColor[1,0,0]}]; b = Plot[Sum[x^i,{i,0,7}],{x,-1,1}]; c = Show[a,b,PlotLabel->"y = 1/(1-x) vs degree 7 approximation "]; Display["1a.ps",c]; d = Plot[ 1/(1-x) - Sum[x^i,{i,0,7}],{x,-0.5, 0.5}]; e = Plot[(1/2)^7,{x,-1/2,1/2},PlotStyle->{RGBColor[0,0,1]}]; f = Show[d,e,PlotLabel->"Error y = 1/(1-x) vs degree 7 approximation", PlotRange->All]; Display["1ax.ps",f]; ----------------------------------------------------------------------- (b) ln(1+x) 2 3 4 5 n+1 n x - x /2 + x /3 - x /4 + x /5 ... (-1) x /n + .... f(x) = ln(1+x) f'(x) = 1/(1+x) f"(x) = -1/(1+x)^2 f"'(x) = 2/(1+x)^3 f""(x) = -6/(1+x)^4 f""'(x) = 24/(1+x)^5 f"""(x) = -120/(1+x)^6 f"""'(x) = 720/(1+x)^7 f""""(x) = 5040/(1+x)^8 (8) f (c) 8 5040 8 Error < ----- (1/2) < ---------- (1/2) 8! 8 (1/2) 8! ----------------------------------------------------------------------- Get["font.math"]; f[x_] := Sum[-(-1)^n x^n/n,{n,1,7}]; a = Plot[Log[1+x],{x,-0.99, 2},PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]; b = Plot[f[x],{x,-1.1, 1.5},PlotStyle->{Thickness[0.005]}]; c = Show[a,b,PlotLabel->"red=y = ln(1+x); black = first seven terms ", PlotRange->{{-1,1.5},{-2.5,2}}]; Display["1bx.ps",c]; d = Plot[ Log[1+x] - f[x],{x,-0.51, 0.51}]; e = ListPlot[ {{-0.5,Log[1/2]-f[-1/2]},{0.5, Log[3/2]-f[1/2]}}, PlotStyle->{RGBColor[1,0,0],PointSize[0.01]}]; h = Plot[-1/8,{x,-0.51,0.51},PlotStyle->{RGBColor[0,0,1]}]; k = Show[d,e,h,PlotLabel->"Error y = ln(1+x) vs degree 7 approximation", PlotRange->All]; Display["1by.ps",k]; ----------------------------------------------------------------------- c) ArcTan[x] 3 5 7 n 2n+1 x - x /3 + x /5 - x /7 ... (-1) x /(2n+1) R = 1 9 9 Error < |x| /9 <= (1/2) /9 = 0.000217014 ----------------------------------------------------------------------- Get["font.math"]; f[x_] := Sum[ (-1)^n x^(2n+1)/(2n+1),{n,0,7}]; a = Plot[ArcTan[x],{x,-1.5,1.5}, PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]; b = Plot[f[x],{x,-1.2, 1.2},PlotStyle->{Thickness[0.005]}]; c = Show[a,b,PlotLabel->"red = ArcTan[x]; black = first seven terms ", PlotRange->All]; Display["1cx.ps",c]; d = Plot[ ArcTan[x] - f[x], {x,-0.75, 0.75}]; e = ListPlot[ {{-1/2,ArcTan[-1/2]-f[-1/2]},{1/2,ArcTan[1/2]-f[1/2]}}, PlotStyle->{RGBColor[1,0,0],PointSize[0.01]}]; h = Plot[{-0.000217014,0.000217014},{x,-0.75,0.75}, PlotStyle->{RGBColor[0,0,1]}]; k = Show[d,e,h,PlotLabel->"Error y = Arctan[x] vs degree 7 approximation", PlotRange->All]; Display["1cy.ps",k]; ----------------------------------------------------------------------- x (d) e 2 3 n 1 + x /2 + x /3! + .... + x /n! R = Infinity c 1/2 8 -7 Error = e x^8/8! < E (1/2) /8! = 1.5973 10 ----------------------------------------------------------------------- Get["font.math"]; f[x_] := Sum[ x^n/n!,{n,0,7}]; a = Plot[E^x,{x,-3 ,1},PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]; b = Plot[f[x],{x,-3, 1},PlotStyle->{Thickness[0.005]}]; c = Show[a,b,PlotLabel->"y = e^x vs first seven terms ",PlotRange->All]; Display["1dx.ps",c]; d = Plot[ E^x - f[x],{x,-0.6, 0.6}]; e = ListPlot[ {{-1/2,E^(-1/2) - f[-1/2]},{1/2, E^(1/2) - f[1/2]}}, PlotStyle->{RGBColor[1,0,0],PointSize[0.01]}]; h = Plot[ {-1.5973 10^(-7),1.5973 10^(-7)},{x,-0.6,0.6}, PlotStyle->{RGBColor[0,0,1]}]; k = Show[d,e,h,PlotLabel->"Error y = e^x vs degree 7 approximation", PlotRange->All]; Display["1dy.ps",k]; ----------------------------------------------------------------------- (e) Sin[x] 3 5 7 n 2n+1 x - x /3! + x /5! - x /7! (-1) x /(2n+1)! R = Infinity 9 9 -9 Error < x /9! < (1/2) /9! = 5.38229 10 ----------------------------------------------------------------------- Get["font.math"]; f[x_] := Sum[ (-1)^n x^(2n+1)/(2n+1)!,{n,0,3}]; a = Plot[Sin[x],{x,-8 ,8 },PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]; b = Plot[f[x],{x,-3.6 , 3.6},PlotStyle->{Thickness[0.005]} ]; c = Show[a,b,PlotLabel->"y = Sin[x] vs degree 7 approximation ", PlotRange->All]; Display["1ex.ps",c]; d = Plot[ Sin[x] - f[x],{x,-0.5, 0.5}]; e = ListPlot[ {{-1/2, Sin[-1/2]-f[-1/2]},{1/2, Sin[1/2]-f[1/2]}}, PlotStyle->{RGBColor[1,0,0],PointSize[0.01]}]; h = Plot[{-5.38229 10^(-9),5.38229 10^(-9)},{x,-1/2,1/2}, PlotStyle->{RGBColor[0,0,1]}]; k = Show[d,e,h,PlotLabel->"Error y = Sin[x] vs degree 7 approximation", PlotRange->All]; Display["1ey.ps",k]; ----------------------------------------------------------------------- (f) Cos[x] 2 4 6 n 2n 1 - x /2 + x /4 - x /6 ... (-1) x /(2n)! R = Infinity 8 8 -8 Error < x /8! < (1/2) /8! = 9.68812 10 ----------------------------------------------------------------------- Get["font.math"]; f[x_] := Sum[ (-1)^n x^(2n)/(2n)!,{n,0,3}]; a = Plot[Cos[x],{x,-10 ,10},PlotStyle->{Thickness[0.005]}]; b = Plot[ f[x],{x,-3.1 , 3.1},PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]; c = Show[a,b,PlotLabel->"y = Cos[x] vs degree 6 approximation ", PlotRange->All]; Display["1fx.ps",c]; d = Plot[ Cos[x] - f[x] ,{x,-0.5, 0.5}]; e = ListPlot[ {{-1/2,Cos[-1/2]-f[-1/2]},{1/2,Cos[1/2]-f[1/2]}}, PlotStyle->{RGBColor[1,0,0],PointSize[0.01]}]; h = Plot[{-9.68812 10^(-8),9.68812 10^(-8)},{x,-0.5,0.5}, PlotStyle->{RGBColor[0,0,1]}]; k = Show[d,e,h,PlotLabel->"Error y = Cos[x] vs degree 7 approximation", PlotRange->All]; Display["1fy.ps",k]; ----------------------------------------------------------------------- (g) Sinh[x] 3 5 2n+1 x + x /3! + x /5! + ... + x /(2n+1)! + ... R = Infinity Sinh[1/2] 8 -8 Error < --------- x < 5.04843 10 8! ----------------------------------------------------------------------- Get["font.math"]; f[x_] := Sum[ x^(2n+1)/(2n+1)!,{n,0,3}]; a = Plot[Sinh[x],{x,-5,5},PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]; b = Plot[f[x],{x,-5,5},PlotStyle->{Thickness[0.005]}]; c = Show[a,b,PlotLabel->"y = Sinh[x] vs degree 7 approximation", PlotRange->All]; Display["1gx.ps",c]; d = Plot[ Sinh[x] - f[x],{x,-0.7, 0.7}]; e = ListPlot[ {{-1/2,Sinh[-1/2]-f[-1/2]},{1/2,Sinh[1/2]-f[1/2]}}, PlotStyle->{RGBColor[1,0,0],PointSize[0.01]}]; h = Plot[{-5.04843 10^(-8),5.04843 10^(-8)},{x,-0.7,0.7}, PlotStyle->{RGBColor[0,0,1]}]; k = Show[d,e,h,PlotLabel->"Error y = Sinh[x] vs degree 7 approximation", PlotRange->All]; Display["1gy.ps",k]; ----------------------------------------------------------------------- (h) Cosh[x] 2 4 2n 1 + x /2! + x /4! + ... + x /(2n)! + ... R = Infinity 8 -7 Error < Cosh[1/2] (1/2) /8! = 1.09246 10 ----------------------------------------------------------------------- Get["font.math"]; f[x_] := Sum[ x^(2n)/(2n)!,{n,0,3}]; a = Plot[Cosh[x],{x,-1,1},PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]; b = Plot[f[x],{x,-1,1},PlotStyle->{Thickness[0.005]}]; c = Show[a,b,PlotLabel->"y = Cosh[x] vs first seven terms ",PlotRange->All]; Display["1hx.ps",c]; d = Plot[ Cosh[x] - f[x],{x,-0.5, 0.5}]; e = ListPlot[ {{-1/2,Cosh[-1/2]-f[-1/2]},{1/2,Cosh[1/2]-f[1/2]}}, PlotStyle->{RGBColor[1,0,0],PointSize[0.01]}]; h = Plot[{-1.09246 10^(-7),1.09246 10^(-7)},{x,-0.5,0.5}, PlotStyle->{RGBColor[0,0,1]}]; k = Show[d,e,h,PlotLabel->"Error y = Cosh[x] vs degree 7 approximation", PlotRange->All]; Display["1hy.ps",k]; ----------------------------------------------------------------------- 2. (a) Write the power series for y = Cos[Sqrt[x] ]. (b) What is its radius of convergence. (c) What is the error by truncating the series at degree 8 on the interval [-8,8]; 2 2 3 n n Cos[x ] = 1 - x/2! + x /4! - x 6! + ...+ (-1) x /(2n)! R = Infinity (although Sqrt[x] is only defined for positive x) For Positive x, the series is alternating. 9 9 -8 Error < x /18! < 8 /18! = 2.09637 10 ----------------------------------------------------------------------- Get["font.math"]; f[x_] := Sum[ (-1)^n x^n/(2n)!,{n,0,8}]; a = Plot[ Cos[Sqrt[Abs[x]]],{x, 0, 12}, PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]; b = Plot[f[x],{x, 0, 12},PlotStyle->{Thickness[0.005]}]; c = Show[a,b,PlotLabel->"y = Cos[Sqrt[x]] vs degree 8 polynomial ", PlotRange->All]; Display["2x.ps",c]; d = Plot[ Cos[Sqrt[Abs[x]]] - f[Abs[x]],{x, -8, 8}, PlotStyle->{Thickness[0.01]}]; e = ListPlot[ {{ 8, Cos[Sqrt[8]]-f[8]}}, PlotStyle->{RGBColor[1,0,0],PointSize[0.015]}]; h = Plot[ -2.09637 10^(-8),{x,-8,8}, PlotStyle->{RGBColor[0,0,1]}]; k = Show[d,e,h,PlotLabel->"Error y = Cos[Sqrt[x]] vs degree 8 approximation", PlotRange->All]; Display["2y.ps",k]; ----------------------------------------------------------------------- 2 3. (a) Write the power series for y = ln(1+x ). (b) What is its radius of convergence. (c) How what degree polynomial is necessary to have an accuracy of 0.00001 on the interval (-1/2,1/2) ? 2 3 4 n n ln(1+x) = x - x /2 + x /3 - x /4 + ... -(-1) x /n + ... 2 2 4 6 8 n 2n ln(1+x ) = x - x /2 + x /3 - x /4 + ... -(-1) x /n + ... R = 1 2n+2 x /(n+1) < 0.00001 2n+2 (1/2) /(n+1) < 0.00001 5 2n+2 10 < (n+1) 2 f[n_] := (n+1) 2^(2n+2); Do[ Print[n," ",f[n]],{n,1,10}] 1 32 2 192 3 1024 4 5120 5 24576 6 114688 <------- n = 6 is sufficient since 10^5 = 100,000 7 524288 8 2359296 9 10485760 10 46137344 ----------------------------------------------------------------------- Get["font.math"]; f[x_] := Sum[ -(-1)^n x^(2n)/n, {n,1,6}]; a = Plot[ Log[1+x^2],{x,-1,1},PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]; b = Plot[ f[x], {x,-0.9, 0.9},PlotStyle->{Thickness[0.005]}]; c = Show[a,b,PlotLabel->"y = Log[1+x^2] vs degree 5 polynomial ", PlotRange->All]; Display["3x.ps",c]; d = Plot[ Log[1+x^2] - f[x],{x, -0.51, 0.51}]; e = ListPlot[ { {-1/2, Log[1+1/4]-f[-1/2] }, { 1/2, Log[1+1/4]-f[1/2] }}, PlotStyle->{RGBColor[1,0,0],PointSize[0.015]}]; h = Plot[0.00001,{x,-0.51,0.51}, PlotStyle->{RGBColor[0,0,1]}]; k = Show[d,e,h,PlotLabel->"Error y = ln(1+x^2) vs degree 6 approximation", PlotRange->All]; Display["3y.ps",k]; ============================================================================ 4. (a) Write the degree 3 MacLaurin polynomial for y = ln(1+x+x^2) (b) Give a bound on the accuracy of your approximation on (-1/2,1/2). 2 y = ln(1+x+x ) y(0) = 0 1+2x y' = ------------ y'(0) = 1 1+x+x^2 2 2 (1+x+x )2 -(1+2x)(1+2x) 1-2x-2x y" = ------------------------ = --------------- y"(0) = 1 2 2 2 2 (1+x+x ) (1+x+x ) 2 2 2 2 (1+x+x ) (-2-4x) - (1-2x-2x )2(1+x+x )(1+2x) y"' = ------------------------------------------------ 2 4 (1+x+x ) 2 3 -4 - 6 x + 6 x + 4 x = -------------------------- y"'(0) = -4 2 3 (1+x+x ) The series begins 2 3 x + x /2 - 4x /3! 2 3 2 2 3 2 2 (1+x+x ) (-6 + 12 x + 12 x )-(-4-6x+ 6x +4x )3(1+x+x ) (1+2x) y"" = ---------------------------------------------------------------------- 2 6 (1+x+x ) 2 3 4 6 (1 + 8 x + 6 x - 4 x - 2 x ) y"" = -------------------------------- 2 4 (1 + x + x ) 6(1+4+6/4+4/8+2/16) y"" < ------------------ = 135.111 4 (3/4) 135.111 4 Error < -------- (1/2) = 0.351852 4! ----------------------------------------------------------------------- Get["font.math"]; f[x_] := x + x^2/2 -4 x^3/3!; g[x_] := Log[1+x+x^2]; a = Plot[ Log[1 + x + x^2],{x,-1,1}, PlotStyle->{RGBColor[1,0,0],Thickness[0.01]}]; b = Plot[ f[x] , {x,-1, 1},PlotStyle->{Thickness[0.005]}]; c = Show[a,b,PlotLabel->"y = Log[1+x+x^2] vs degree 3 polynomial ", PlotRange->All]; Display["4x.ps",c]; d = Plot[ g[x] - f[x], {x, -1.15, 1.15}]; e = ListPlot[ { {-1/2, g[-1/2]-f[-1/2] }, { 1/2, g[ 1/2]-f[1/2] }}, PlotStyle->{RGBColor[1,0,0],PointSize[0.015]}]; h = Plot[{-0.351852,0.351852},{x,-1.15, 1.15}, PlotStyle->{RGBColor[0,0,1]}]; k = Show[d,e,h,PlotLabel->"Error y = ln(1+x+x^2) vs degree 3 approximation", PlotRange->All]; Display["4y.ps",k]; ----------------------------------------------------------------------- 5. Find the radius of convergence of n Infinity 3 n SUM ------ x n=1 n 1+2 a n+1 n n n+1 3 n+1 1+2 1+2 ---- = ---------- x * --------- = ------- 3x a n+1 n n n+1 n 1+2 3 x 1+2 a n+1 Limit ----- = 3/2 x n->Infinity a n R = 2/3 <=================== ----------------------------------------------------------------------- Get["font.math"]; f[n_,x_] := Sum[ 3^i/(1+2^i) x^i,{i,0,n}]; A = Table[ Plot[ f[n,x],{x,-0.8,0.8},PlotStyle->{RGBColor[1,0,0]}], {n,1,100,20}]; b = ListPlot[{{-2/3,f[100,-2/3]},{2/3,f[100,2/3]}}, PlotStyle->{RGBColor[1,0,0],PointSize[0.015]}]; c = Show[A,b,PlotLabel->"y = Sum 3^n/(1+2^n) x^n Problem 5 ", PlotRange->{{-0.8,0.8},{-200,200}}]; Display["5.ps",c]; ----------------------------------------------------------------------- 6. Prove that the series converges Infinity Sin[n] SUM -------- n=1 n 3 Infinity | Sin[x] | Infinity 1 SUM |-------- | <= SUM ------ n=1 | n | n=1 n | 3 | 3 This is a geometric series , p = 1/3 and converges. Therefore the original series converges absolutely by the comparison test. Therefore the original series converges by the absolute convergence theorem. 7. Prove that the series converges Infinity Sin[1/n] SUM ---------- n=1 2 n Infinity | Sin[1/n] | Infinity 1 SUM |-----------| < SUM ----- n=1 | 2 | n=1 2 n n This is a p-series, p = 2 and it converges. The original series is absolutely convergent by the comparison test. The original series converges by the absolute convergence theorem. 8. Prove that the series converges Infinity 2n+1 SUM -------- n=1 2 n + n + 1 2 f(x) = (2x+1)/(x +x+1) 2 2 (x +x+1)2-(2x+1)(2x+1) 1 - 2 x - 2 x f'(x) = ----------------------- = ----------------- 2 2 2 2 (x +x+1) (x +x+1) Since f'(x) is eventually negative we can use the integral test. Infinity | 2x+1 2 | x=Infinity INT | ---------- = ln(x +x+1) | = Infinity x=1 | 2 | x=1 | x +x+1 | Therefore the original series diverges by the integral test. th 9. State and prove the n term test for divergence. Infinity If SUM a Converges, then Limit a = 0 n=1 n n->Infinity n Proof. Limit a = Limit ( Sn - Sn-1) n->Infinity n n->Infinity = Limit Sn - Limit Sn-1 = 0 n->Infinity n->Infinity th 10. State and prove the n term test for convergence of an alternating series. Infinity n If a decreases to zero then SUM (-1) a converges. n n=0 n Proof: (ao-a1)+(a2-a3) .... is positive ao-(a1-a2)-(a3-a4) ... is less than ao. Therefore S is positive and bounded and converges. 2n Limit S = Limit (S + a ) = Limit S + Limit a = Limit S 2n+1 2n 2n+1 2n 2n+1 2n n->Infinity n->Infinity n->Infinity n->Infinity n->Infinity 11. State and prove the integral test. If f(x) is positive and decreasing then Infinity Infinity SUM f(n) converges if and only if INT f(x) dx converges n=0 x=0 Infinity Infinity Infinity SUM f(n) <= INT f(x) dx <= SUM f(n) n=1 n=0 n=0 If the integral exists, then the series is bounded and converges. If the integral is unbounded, then the series is unbounded. 12. State the ratio test. a n+1 If a > 0 and Limit ----------- = r n a n Then: the series converges if 0 <= r < 1 the series diverges if r > 1 when r = 1 the series may converge or may diverge