This week, we’ll work out some Taylor Series expansions of popular functions. For each function, only consider its valid ranges as indicated in the notes when you are computing the Taylor Series expansion.

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

The Taylor Series expansion for \(f (x) = \frac{1}{(1-x)}\) is:

\[ f (x) = \frac{1}{(1-x)} = \sum_{n=0}^{\infty} x^n = 1 + x + x^2 + x^3 + x^4 ... \]

curve(1/(1-x), -0.99, 0.99, ylim=c(-10, 10))
curve(1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^7, -0.99, 0.99, col='blue', add=TRUE)


2. \(f(x) = e^x\)

The Taylor Series expansion for \(f(x) = e^x\) is: \[ f (x) = e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} ... \]

curve(exp(x), -2, 2, ylim=c(0, 8))
curve(1 + x + x^2/2 + x^3/6 + x^4/24, -2, 2, col='blue', add=TRUE)


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

The Taylor Series expansion for \(f(x) = \ln(1 + x)\) is:

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

\[ f(x) = ln(1 + x) = \sum_{n=1}^{\infty} \frac{-1^nx^n}{n} = x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} ... \]

curve(log(1+x), -0.99, 0.99)
curve(x - x^2/2 + x^3/3 - x^4/4, -0.99, 0.99, col='blue', add=TRUE)


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

The Taylor series for \(f(x)=x^{1/2}\) is not computed as the function is not differentiable at \(x = 0\).

For visualizing the function itself, we can start just above zero:

curve(sqrt(x), 0.01, 2, ylim=c(0, 1.5), xlab="x", ylab="f(x)")