# 10.12 Maclaurin series

Some functions can be written as an "infinite power series", which is a sum in the form

$a+bx+cx^{2}+dx^{3}+...$

How would we find the values of $a,b,c,d,...$ for a specific function?

Differentiation! Let’s take $\sin(x)$:

 $\displaystyle\sin(x)$ $\displaystyle=c_{1}+c_{2}x+c_{3}x^{2}+c_{4}x^{3}+...$ (10.113) $\displaystyle\cos(x)$ $\displaystyle=c_{2}+2c_{3}x+3c_{4}x^{2}+...$ (By differentiating both sides) $\displaystyle-\sin(x)$ $\displaystyle=2c_{3}+3\cdot 2c_{4}x+4\cdot 3c_{5}x^{2}...$ (By differentiating both sides again) $\displaystyle-\cos(x)$ $\displaystyle=3\cdot 2\cdot 1c_{4}+4\cdot 3\cdot 2c_{5}x$ (By differentiating both sides once more) $\displaystyle\sin(x)$ $\displaystyle=4\cdot 3\cdot 2\cdot 1c_{5}x$ (Differentating again) $\displaystyle...$ (10.114)

How do we find the value of a coefficient? Another algebra trick - plug in a specific value for $x$, in this case $0$. This is because every term in the power series, except the constant one, depends on $x$ and thus is zero when $x$ is zero. In order to find the value of the next constant, we can just differentiate, which brings all the powers down by one.

Therefore

 $\displaystyle c_{1}$ $\displaystyle=\sin(0)$ $\displaystyle c_{2}$ $\displaystyle=\cos(0)$ $\displaystyle 2c_{3}$ $\displaystyle=-\sin(0)$ $\displaystyle 3\cdot 2\cdot 1c_{4}$ $\displaystyle=-\cos(x)$ $\displaystyle 4\cdot 3\cdot 2\cdot 1c_{5}$ $\displaystyle=\sin(x)$ $\displaystyle...$

This leads directly to the general case (i.e. the value of $c_{n}$)

$c_{n}=\frac{\sin^{(n)}(0)}{n!}$ (10.115)

Where $sin^{(n)}(0)$ means the value of the nth derivative at the point $x=0$. Therefore, overall, we can write the power series of any function1818 18 Note that are some additional conditions - the function must be infinitely differentiable (we can keep differentiating forever) and each derivative must be defined at the point $x=0$. as

$f(x)=\sum_{s=0}^{\infty}\left[\frac{f^{(s)}(0)}{s!}x^{s}\right]$ (10.116)

Maclaurin series of common functions

This is just a list, which is also given in the formula booklet.

## 10.12.1 Derivation of the sum of an infinite geometric series

###### Example 10.12.1

Prove the formula for a sum of an infinite geometric series using Maclaurin series.

We know1919 19 If not, see Section 3.4.2 that

$\frac{1}{1-z}=1+z+z^{2}+z^{3}+...$ (10.117)

This can be derived by finding an expression for the $n$th derivative of $\frac{1}{1-z}$.

Finding the first few derivatives,

$\frac{d}{dz}\left[\frac{1}{1-z}\right]=\frac{d}{dz}\left[(1-z)^{-1}\right]$ (10.118)

By the chain rule, this gives that the first derivative is equal to

$(-1)\cdot(-1)(1-z)^{-2}=(1-z)^{-2}$ (10.119)

The second derivative is equal to

$2(1-z)^{-3}$ (10.120)

The third is

$1\cdot 2\cdot 3(1-z)^{-4}$ (10.121)

And so on (this can be proved by induction). Therefore, the Maclaurin expansion for the function is

 $\displaystyle\frac{1}{1-z}$ $\displaystyle=\sum_{k\geqq 0}\left[\frac{\text{kth derivative at 0}}{k!}z^{k}\right]$ (10.122) $\displaystyle=\sum_{k\geqq 0}\left[\frac{k!(1-0)^{-k-1}}{k!}z^{k}\right]$ (10.123) $\displaystyle=\sum_{k\geqq 0}\left[z^{k}\right]$ (10.124) $\displaystyle=1+z+z^{2}+z^{3}+...$ (10.125)

## 10.12.2 A lower bound for the factorial function

This is a really cool method (which I discovered originally on Terence Tao’s blog) to find a lower bound for the factorial function2020 20 The factorial function is defined as $n!=n\cdot(n-1)\cdot...\cdot 1$. The first step is to consider the Maclaurin series for $e^{x}$, i.e.

$e^{x}=\sum_{n\geqq 0}\frac{x^{n}}{n!}$ (10.126)

If we specify that $x>0$, then all the terms in the series are positive, so any individual term of the series will be smaller than the term we have selected and thus we can select the term where $x=n$ ($n>0$) which satisfies

$e^{x}\geqq\frac{n^{n}}{n!}$ (10.127)

Therefore,

$n!\geqq\frac{n^{n}}{e^{x}}$ (10.128)

This is closely related to Stirling’s formula (a closed-form approximation for the factorials which shows up in quite a few places) - the linked blog post gives the full derivation.