Skip to main content

Maclaurin and Taylor Series — Diagnostic Tests

Unit Tests

UT-1: Standard Maclaurin Expansions

Question: Write the Maclaurin series up to the x4x^4 term for: (a) exe^x, (b) ln(1+x)\ln(1 + x), (c) sinx\sin x, (d) (1+x)n(1 + x)^n.

Solution:

(a) ex=1+x+x22!+x33!+x44!+=1+x+x22+x36+x424+e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \cdots = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \frac{x^4}{24} + \cdots

(b) ln(1+x)=xx22+x33x44+\ln(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \cdots (valid for 1<x1-1 \lt x \le 1).

(c) sinx=xx33!+x55!=xx36+x5120\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots = x - \frac{x^3}{6} + \frac{x^5}{120} - \cdots (valid for all xx).

(d) (1+x)n=1+nx+n(n1)2!x2+n(n1)(n2)3!x3+n(n1)(n2)(n3)4!x4+(1+x)^n = 1 + nx + \frac{n(n-1)}{2!}x^2 + \frac{n(n-1)(n-2)}{3!}x^3 + \frac{n(n-1)(n-2)(n-3)}{4!}x^4 + \cdots (valid for x<1|x| \lt 1).

UT-2: Maclaurin Series from First Principles

Question: (a) Find the Maclaurin series of cosx\cos x up to x6x^6. (b) Find the Maclaurin series of e2xe^{2x} up to x4x^4. (c) Find the Maclaurin series of 11x\frac{1}{1-x} and state its radius of convergence. (d) Use the series for 11x\frac{1}{1-x} to find the series for 11+x2\frac{1}{1+x^2}.

Solution:

(a) f(x)=cosxf(x) = \cos x, f(0)=1f(0) = 1. f(x)=sinxf'(x) = -\sin x, f(0)=0f'(0) = 0. f(x)=cosxf''(x) = -\cos x, f(0)=1f''(0) = -1. f(x)=sinxf'''(x) = \sin x, f(0)=0f'''(0) = 0. f(4)(x)=cosxf^{(4)}(x) = \cos x, f(4)(0)=1f^{(4)}(0) = 1. f(5)(0)=0f^{(5)}(0) = 0, f(6)(0)=1f^{(6)}(0) = -1.

cosx=1x22!+x44!x66!+=1x22+x424x6720+\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots = 1 - \frac{x^2}{2} + \frac{x^4}{24} - \frac{x^6}{720} + \cdots

(b) f(x)=e2xf(x) = e^{2x}, f(n)(x)=2ne2xf^{(n)}(x) = 2^n e^{2x}, f(n)(0)=2nf^{(n)}(0) = 2^n. e2x=1+2x+4x22+8x36+16x424+=1+2x+2x2+4x33+2x43+e^{2x} = 1 + 2x + \frac{4x^2}{2} + \frac{8x^3}{6} + \frac{16x^4}{24} + \cdots = 1 + 2x + 2x^2 + \frac{4x^3}{3} + \frac{2x^4}{3} + \cdots

(c) f(x)=(1x)1f(x) = (1-x)^{-1}. f(n)(x)=n!(1x)n1f^{(n)}(x) = n!(1-x)^{-n-1}, f(n)(0)=n!f^{(n)}(0) = n!. 11x=n=0xn=1+x+x2+x3+\frac{1}{1-x} = \sum_{n=0}^{\infty} x^n = 1 + x + x^2 + x^3 + \cdots

This is a geometric series with ratio xx. Converges when x<1|x| \lt 1. Radius of convergence =1= 1.

(d) Substitute xx2x \to -x^2: 11+x2=1x2+x4x6+\frac{1}{1+x^2} = 1 - x^2 + x^4 - x^6 + \cdots (valid for x<1|x| \lt 1).

UT-3: Series Manipulation

Question: (a) Find the Maclaurin series of ex1x\frac{e^x - 1}{x} up to x3x^3. (b) Find the Maclaurin series of xln(1+x)x\ln(1+x) up to x4x^4. (c) Find the Maclaurin series of cos2x\cos^2 x up to x4x^4 using the identity cos2x=LB1+cos2xRB◆◆LB2RB\cos^2 x = \frac◆LB◆1 + \cos 2x◆RB◆◆LB◆2◆RB◆. (d) Evaluate limx0ex1xx2\lim_{x \to 0}\frac{e^x - 1 - x}{x^2} using series.

Solution:

(a) ex=1+x+x2/2+x3/6+e^x = 1 + x + x^2/2 + x^3/6 + \cdots. ex1=x+x2/2+x3/6+e^x - 1 = x + x^2/2 + x^3/6 + \cdots. ex1x=1+x2+x26+\frac{e^x - 1}{x} = 1 + \frac{x}{2} + \frac{x^2}{6} + \cdots

(b) ln(1+x)=xx2/2+x3/3x4/4+\ln(1+x) = x - x^2/2 + x^3/3 - x^4/4 + \cdots xln(1+x)=x2x32+x43x54+x\ln(1+x) = x^2 - \frac{x^3}{2} + \frac{x^4}{3} - \frac{x^5}{4} + \cdots

(c) cos2x=1(2x)22+(2x)424+=12x2+2x43+\cos 2x = 1 - \frac{(2x)^2}{2} + \frac{(2x)^4}{24} + \cdots = 1 - 2x^2 + \frac{2x^4}{3} + \cdots cos2x=12(22x2+2x43)=1x2+x43+\cos^2 x = \frac{1}{2}\left(2 - 2x^2 + \frac{2x^4}{3}\right) = 1 - x^2 + \frac{x^4}{3} + \cdots

(d) ex1x=x22+x36+e^x - 1 - x = \frac{x^2}{2} + \frac{x^3}{6} + \cdots. ex1xx2=12+x6+\frac{e^x - 1 - x}{x^2} = \frac{1}{2} + \frac{x}{6} + \cdots. limx0=12\lim_{x \to 0} = \frac{1}{2}.


Integration Tests

IT-1: Taylor Series about a Point (with Calculus)

Question: (a) Find the Taylor series of lnx\ln x about x=1x = 1 up to (x1)4(x-1)^4. (b) Use the result to approximate ln1.1\ln 1.1 correct to 4 decimal places. (c) Estimate the error in the approximation. (d) Explain why the Maclaurin series of lnx\ln x does not exist.

Solution:

(a) f(x)=lnxf(x) = \ln x, f(1)=0f(1) = 0. f(x)=1/xf'(x) = 1/x, f(1)=1f'(1) = 1. f(x)=1/x2f''(x) = -1/x^2, f(1)=1f''(1) = -1. f(x)=2/x3f'''(x) = 2/x^3, f(1)=2f'''(1) = 2. f(4)(x)=6/x4f^{(4)}(x) = -6/x^4, f(4)(1)=6f^{(4)}(1) = -6.

lnx=(x1)(x1)22+(x1)33(x1)44+\ln x = (x-1) - \frac{(x-1)^2}{2} + \frac{(x-1)^3}{3} - \frac{(x-1)^4}{4} + \cdots

(b) With x=1.1x = 1.1, h=0.1h = 0.1: ln1.10.10.005+0.0003330.000025=0.0953080.0953\ln 1.1 \approx 0.1 - 0.005 + 0.000333 - 0.000025 = 0.095308 \approx 0.0953.

(c) The next term is (0.1)55=0.000002\frac{(0.1)^5}{5} = 0.000002. The error is less than the magnitude of the first omitted term: error <0.000002\lt 0.000002. So ln1.1=0.0953\ln 1.1 = 0.0953 to 4 d.p. (Actual: 0.0953100.095310.)

(d) f(0)=ln0f(0) = \ln 0 is undefined, so f(n)(0)f^{(n)}(0) does not exist for lnx\ln x. The Maclaurin series requires the function and all its derivatives to be defined at x=0x = 0.

IT-2: Series for Integration (with Further Calculus)

Question: (a) Use series to evaluate 00.5LBsinxRB◆◆LBxRBdx\int_0^{0.5} \frac◆LB◆\sin x◆RB◆◆LB◆x◆RB◆\,dx correct to 6 decimal places. (b) Use the series for exe^x to find the Maclaurin series of exex2\frac{e^x - e^{-x}}{2} (hyperbolic sine, sinhx\sinh x). (c) Evaluate 00.2sinhxdx\int_0^{0.2} \sinh x\,dx using the series. (d) Find the Maclaurin series of ex2e^{x^2} and use it to find 00.5ex2dx\int_0^{0.5} e^{x^2}\,dx.

Solution:

(a) sinx=xx3/6+x5/120\sin x = x - x^3/6 + x^5/120 - \cdots. LBsinxRB◆◆LBxRB=1x2/6+x4/120\frac◆LB◆\sin x◆RB◆◆LB◆x◆RB◆ = 1 - x^2/6 + x^4/120 - \cdots. 00.5LBsinxRB◆◆LBxRBdx=[xx318+x5600]00.5=0.50.12518+0.03125600\int_0^{0.5} \frac◆LB◆\sin x◆RB◆◆LB◆x◆RB◆\,dx = \left[x - \frac{x^3}{18} + \frac{x^5}{600}\right]_0^{0.5} = 0.5 - \frac{0.125}{18} + \frac{0.03125}{600} =0.50.006944+0.000052=0.4931080.493108= 0.5 - 0.006944 + 0.000052 = 0.493108 \approx 0.493108.

(b) ex=1+x+x2/2!+x3/3!+e^x = 1 + x + x^2/2! + x^3/3! + \cdots. ex=1x+x2/2!x3/3!+e^{-x} = 1 - x + x^2/2! - x^3/3! + \cdots. sinhx=exex2=x+x33!+x55!+=x+x36+x5120+\sinh x = \frac{e^x - e^{-x}}{2} = x + \frac{x^3}{3!} + \frac{x^5}{5!} + \cdots = x + \frac{x^3}{6} + \frac{x^5}{120} + \cdots

(c) 00.2sinhxdx=[x22+x424+x6720]00.2=0.02+0.001624+0.000064720\int_0^{0.2} \sinh x\,dx = \left[\frac{x^2}{2} + \frac{x^4}{24} + \frac{x^6}{720}\right]_0^{0.2} = 0.02 + \frac{0.0016}{24} + \frac{0.000064}{720} =0.02+0.0000667+0.0000001=0.020067= 0.02 + 0.0000667 + 0.0000001 = 0.020067.

(d) ex2=1+x2+x42!+x63!+=1+x2+x42+x66+e^{x^2} = 1 + x^2 + \frac{x^4}{2!} + \frac{x^6}{3!} + \cdots = 1 + x^2 + \frac{x^4}{2} + \frac{x^6}{6} + \cdots 00.5ex2dx=[x+x33+x510+x742]00.5=0.5+0.1253+0.0312510+0.007812542\int_0^{0.5} e^{x^2}\,dx = \left[x + \frac{x^3}{3} + \frac{x^5}{10} + \frac{x^7}{42}\right]_0^{0.5} = 0.5 + \frac{0.125}{3} + \frac{0.03125}{10} + \frac{0.0078125}{42} =0.5+0.04167+0.003125+0.000186=0.54498= 0.5 + 0.04167 + 0.003125 + 0.000186 = 0.54498.

IT-3: Convergence and Applications (with Complex Numbers)

Question: (a) Find the Maclaurin series of (1x)1/2(1-x)^{-1/2} and determine its radius of convergence. (b) Use the series to approximate LB1RB◆◆LB0.9RB\frac◆LB◆1◆RB◆◆LB◆\sqrt{0.9}◆RB◆ correct to 5 decimal places. (c) The series n=0xnn!\sum_{n=0}^{\infty} \frac{x^n}{n!} converges for all xx. Use this to show that n=0(1)nn!=1e\sum_{n=0}^{\infty} \frac{(-1)^n}{n!} = \frac{1}{e}. (d) Explain why n=11n\sum_{n=1}^{\infty} \frac{1}{n} diverges while n=1(1)nn\sum_{n=1}^{\infty} \frac{(-1)^n}{n} converges.

Solution:

(a) (1x)1/2=1+12x+LB13RB◆◆LB24RBx2+LB135RB◆◆LB246RBx3+LB1357RB◆◆LB2468RBx4+(1-x)^{-1/2} = 1 + \frac{1}{2}x + \frac◆LB◆1 \cdot 3◆RB◆◆LB◆2 \cdot 4◆RB◆x^2 + \frac◆LB◆1 \cdot 3 \cdot 5◆RB◆◆LB◆2 \cdot 4 \cdot 6◆RB◆x^3 + \frac◆LB◆1 \cdot 3 \cdot 5 \cdot 7◆RB◆◆LB◆2 \cdot 4 \cdot 6 \cdot 8◆RB◆x^4 + \cdots =1+x2+3x28+5x316+35x4128+= 1 + \frac{x}{2} + \frac{3x^2}{8} + \frac{5x^3}{16} + \frac{35x^4}{128} + \cdots

Radius of convergence: x<1|x| \lt 1 (from the binomial series formula, valid when x<1|x| \lt 1).

(b) With x=0.1x = 0.1: LB1RB◆◆LB0.9RB=1+0.05+0.00375+0.0003125+0.00002734+=1.0540901.05409\frac◆LB◆1◆RB◆◆LB◆\sqrt{0.9}◆RB◆ = 1 + 0.05 + 0.00375 + 0.0003125 + 0.00002734 + \cdots = 1.054090 \approx 1.05409.

(c) n=0xnn!=ex\sum_{n=0}^{\infty} \frac{x^n}{n!} = e^x. Setting x=1x = -1: n=0(1)nn!=e1=1e\sum_{n=0}^{\infty} \frac{(-1)^n}{n!} = e^{-1} = \frac{1}{e}.

(d) n=11n\sum_{n=1}^{\infty} \frac{1}{n} is the harmonic series, which diverges (the partial sums grow without bound, albeit slowly -- lnn\ln n).

n=1(1)nn=1+1213+14\sum_{n=1}^{\infty} \frac{(-1)^n}{n} = -1 + \frac{1}{2} - \frac{1}{3} + \frac{1}{4} - \cdots is an alternating series with terms an=1/na_n = 1/n that decrease to 0. By the alternating series test, it converges (to ln2-\ln 2). The partial sums oscillate above and below ln2-\ln 2, with the amplitude of oscillation decreasing.