Assignment Prompt

This week, we’ll work out some Taylor Series expansions of popular functions. • \(f (x) = \frac{1}{1-x}\)\(f (x) = e^x\)\(f (x) = ln(1 + x)\)\(f(x)=x^{1/2}\) For each function, only consider its valid ranges as indicated in the notes when you are computing the Taylor Series expansion.

The formula for Taylor Series expansion of a real function f(x) about a point \(x = a\):

\[\sum_{n=0}^{ \infty}\frac{f^{(n)}(a)}{n!}(x-a)^{n}\]

\(\sum_{n=0}^{ \infty}\frac{f^{(n)}(a)}{n!}(x-a)^{n}=f(a)+f^{(1)}(a)(x-a)+\frac{f^{(2)}(a)}{2!}(x-a)^{2}+\frac{f^{(3)}(a)}{3!}(x-a)^{3}+\cdots\)

\(f (x) = \frac{1}{1-x}\)

\(f(x) = \frac{1}{1-x}\)

\(f^{(1)}(x)=\frac{1}{(1-x)^2}=\frac{1}{(1-x)^2}\)

\(f^{(2)}(x)=\frac{2}{(1-x)^3}\)

\(f^{(3)}(x)=\frac{6}{(1-x)^4}\)

The Taylor Series expansion of a real function \(f (x) = \frac{1}{1-x}\) about a point \(x = a\):

\(f(x) = \frac{1}{1-x} = \frac{1}{1-a}+\frac{1}{(1-x)^2}(x-a)+\frac{\frac{2}{(1-x)^3}}{2!}(x-a)^{2}+\frac{\frac{6}{(1-x)^4}}{3!}(x-a)^{3}+\cdots\)

\(\frac{1}{1-x}= \frac{1}{1-a}+\frac{x-a}{(1-a)^{2}}+\frac{(x-a)^{2}}{(1-a)^{3}}+\frac{(x-a)^{3}}{(1-a)^{4}} +\cdots\)

If \(x = 0\)

\(f(0) = \frac{1}{1-0} = 1\)

\(f^{(1)}(0)=\frac{1}{(1-0)^2}=1\)

\(f^{(2)}(0)=\frac{2}{(1-0)^3}=2\)

\(f^{(3)}(0)=\frac{6}{(1-0)^4}=6\)

The Taylor Series expansion of a real function \(f (x) = \frac{1}{1-x}\) about a point \(x = 0\):

\(\frac{1}{1-x}= 1+ x + x^{2} + x^{3} + \cdots\)

\(\frac{1}{1-x}=\sum_{n=0}^{ \infty}x^{n}\)

Valid ranges: (-1,1)

R Solution

library(calculus)
taylor("1/(1-x)", 0, var = "x", order = 4)
## $f
## [1] "(1) * 1 + (1) * x^1 + (1) * x^2 + (1) * x^3 + (1) * x^4"
## 
## $order
## [1] 4
## 
## $terms
##   var coef degree
## 0   1    1      0
## 1 x^1    1      1
## 2 x^2    1      2
## 3 x^3    1      3
## 4 x^4    1      4

\(f (x) = e^{x}\)

\(f(x) = e^{x}\)

\(f^{(1)}(x)= e^{x}\)

\(f^{(2)}(x)= e^{x}\)

\(f^{(3)}(x)=e^{x}\)

The Taylor Series expansion of a real function \(f(x) = e^{x}\) about a point \(x = a\):

\(f(x) = e^{x} = e^{a}+e^{x}(x-a)+\frac{e^{a}}{2!}(x-a)^{2}+\frac{e^{a}}{3!}(x-a)^{3}+\cdots\)

\(f(x) = e^{x} = e^{a}[1+(x-a)+\frac{1}{2}(x-a)^{2}+\frac{1}{6}(x-a)^{3}+\cdots\)

The Taylor Series expansion of a real function \(f(x) = e^{x}\) about a point \(x = 0\):

If \(x = 0\)

\(f(x) = e^{0}=1\)

\(f^{(1)}(x)= e^{0}=1\)

\(f^{(2)}(x)= e^{0}=1\)

\(f^{(3)}(x)=e^{0}=1\)

\(e^{x}= 1+ x + \frac{x^{2}}{2}+ \frac{x^{3}}{6}+\cdots\)

\(e^{x}=\sum_{n=0}^{ \infty}\frac{x^{n}}{n!}\)

Valid ranges: \((-\infty,\infty)\)

R Solution

library(calculus)
taylor("exp(x)", 0, var = "x", order = 4)
## $f
## [1] "(1) * 1 + (1) * x^1 + (0.5) * x^2 + (0.166666666666667) * x^3 + (0.0416666666666667) * x^4"
## 
## $order
## [1] 4
## 
## $terms
##   var       coef degree
## 0   1 1.00000000      0
## 1 x^1 1.00000000      1
## 2 x^2 0.50000000      2
## 3 x^3 0.16666667      3
## 4 x^4 0.04166667      4

\(f (x) = ln(1 + x)\)

\(f(x) = ln(1 + x)\)

\(f^{(1)}(x)=\frac{1}{1+x}\)

\(f^{(2)}(x)= - \frac{1}{(1+x)^2}\)

\(f^{(3)}(x)=\frac{2}{(1+x)^3}\)

\(f^{(4)}(x)=-\frac{6}{(1+x)^4}\)

The Taylor Series expansion of a real function \(f(x) = ln(1 + x)\) about a point \(x = a\):

\(f(x) = ln(1 + x) = f(x) = ln(1 + x)+\frac{1}{1+x}(x-a)-\frac{ \frac{1}{(1+x)^2}}{2!}(x-a)^{2}+\frac{\frac{2}{(1+x)^3}}{3!}(x-a)^{3}- \frac{\frac{6}{(1+x)^4}}{4!}(x-a)^{4}\cdots\)

The Taylor Series expansion of a real function \(f(x) = e^{x}\) about a point \(x = 0\):

If \(x = 0\)

\(f(x) = ln(1 + 0) = 0\)

\(f^{(1)}(x)=\frac{1}{1+0} = 1\)

\(f^{(2)}(x)= - \frac{1}{(1+0)^2}= -1\)

\(f^{(3)}(x)=\frac{2}{(1+0)^3}=2\)

\(f^{(4)}(x)=-\frac{6}{(1+0)^4}=-6\)

\(ln(1 + x)=0+x-\frac{x^{2}}{2}+\frac{x^{3}}{3}-\frac{x^{4}}{4}\)

\(ln(1 + x)=\sum_{n=0}^{ \infty}(-1)^{n}\frac{x^{n+1}}{n+1}\)

Valid ranges: (-1,1)

\(f(x)=x^{1/2}\)

\(f(x)=x^{1/2}\)

\(f^{(1)}(x)=\frac{1}{2x^{1/2}}\)

\(f^{(2)}(x)= - \frac{1}{4x^{3/2}}\)

\(f^{(3)}(x)=\frac{3}{8x^{5/2}}\)

\(f^{(4)}(x)=-\frac{15}{(16x^{7/2}}\)

The Taylor Series expansion of a real function \(f(x)=x^{1/2}\) about a point \(x = a\):

\(f(x) = x^{1/2} = f(x) = x^{1/2}+\frac{1}{2x^{1/2}}(x-a)-\frac{ \frac{1}{4x^{3/2}}}{2!}(x-a)^{2}+\frac{\frac{3}{8x^{5/2}}}{3!}(x-a)^{3}- \frac{\frac{15}{(16x^{7/2}}}{4!}(x-a)^{4}\cdots\)

The Taylor Series of \(f(x)=x^{1/2}\) undefined about a point \(x = 0\)

R Solution

library(calculus)
taylor("x^(1/2)", 0, var = "x", order = 4)
## $f
## [1] "(Inf) * x^1 + (-Inf) * x^2 + (Inf) * x^3 + (-Inf) * x^4"
## 
## $order
## [1] 4
## 
## $terms
##   var coef degree
## 0   1    0      0
## 1 x^1  Inf      1
## 2 x^2 -Inf      2
## 3 x^3  Inf      3
## 4 x^4 -Inf      4