Method of substitution

The method of substitution is the among the most basic technique that can be applied to infinite power series. Its use is simple to grasp and easy to master. We will first start with a couple of simple series and build up from there.

Series representation of $e^{-x}$

We know that:

$e^x=1+x+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+\dfrac{x^6}{6!}+O(x^8)$

$e^{-x}=1+(-x)+\dfrac{(-x)^2}{2!}+\dfrac{(-x)^3}{3!}+\dfrac{(-x)^4}{4!}+\dfrac{(-x)^5}{5!}+\dfrac{(-x)^6}{6!}+O(x^8)$

$=1-x+\dfrac{x^2}{2!}-\dfrac{x^3}{3!}+\dfrac{x^4}{4!}-\dfrac{x^5}{5!}+\dfrac{x^6}{6!}+O(x^8)$

Series representation of $e^{-x^2}$

$e^x=1+x+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+\dfrac{x^6}{6!}+O(x^8)$

$e^{-x^2}=1+(-x^2)+\dfrac{(-x^2)^2}{2!}+\dfrac{(-x^2)^3}{3!}+\dfrac{(-x^2)^4}{4!}+\dfrac{(-x^2)^5}{5!}+\dfrac{(-x^2)^6}{6!}+O(x^8)$

$=1-x^2+\dfrac{x^4}{2!}-\dfrac{x^6}{3!}+\dfrac{x^8}{4!}-\dfrac{x^{10}}{5!}+\dfrac{x^{12}}{6!}+O(x^{14})$

Series representation of $\dfrac{1}{\sqrt{2\pi}}e^{\frac{-x^2}{2}}$ (Normal distribution function)

$e^{-x^2}=1-x^2+\dfrac{x^4}{2!}-\dfrac{x^6}{3!}+\dfrac{x^8}{4!}-\dfrac{x^{10}}{5!}+\dfrac{x^{12}}{6!}+O(x^{14})$

$\dfrac{1}{\sqrt{2\pi}}e^{\frac{-x^2}{2}}=\dfrac{1}{\sqrt{2\pi}}\left(1-\dfrac{x^2}{2}+\dfrac{x^4}{4\cdot 2!}-\dfrac{x^6}{8\cdot 3!}+\dfrac{x^8}{16\cdot 4!}-\dfrac{x^{10}}{32\cdot 5!}+\dfrac{x^{12}}{64\cdot 6!}+O(x^{14})\right)$

Series representation of $e^{2x}$

$e^x=1+x+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+\dfrac{x^6}{6!}+O(x^8)$

$e^{2x}=1+2x+\dfrac{(2x)^2}{2!}+\dfrac{(2x)^3}{3!}+\dfrac{(2x)^4}{4!}+\dfrac{(2x)^5}{5!}+\dfrac{(2x)^6}{6!}+O(x^8)$

$=1+2x+\dfrac{4x^2}{2!}+\dfrac{8x^3}{3!}+\dfrac{16x^4}{4!}+\dfrac{32x^5}{5!}+\dfrac{64x^6}{6!}+O(x^8)$

$=1+2x+2x^2+\dfrac{4x^3}{3}+\dfrac{2x^4}{3}+\dfrac{4x^5}{15}+\dfrac{4x^6}{45}+O(x^8)$

Series representation of $\sin(2x)$

$\sin(x)=x-\dfrac{x^3}{3!}+\dfrac{x^5}{5!}-\dfrac{x^7}{7!}+\dfrac{x^9}{9!}-\dfrac{x^{11}}{11!}+\dfrac{x^{13}}{13!}+O(x^{15})$

$\sin(2x)=2x-\dfrac{(2x)^3}{3!}+\dfrac{(2x)^5}{5!}-\dfrac{(2x)^7}{7!}+\dfrac{(2x)^9}{9!}-\dfrac{(2x)^{11}}{11!}+\dfrac{(2x)^{13}}{13!}+O(x^{15})$

$=2x-\dfrac{8x^3}{3!}+\dfrac{32x^5}{5!}-\dfrac{128x^7}{7!}+\dfrac{512x^9}{9!}-\dfrac{2048x^{11}}{11!}+\dfrac{8192x^{13}}{13!}+O(x^{15})$

$=2x-\dfrac{4x^3}{3}+\dfrac{4x^5}{15}-\dfrac{8x^7}{315}+\dfrac{4x^9}{2835}-\dfrac{8x^{11}}{155925}+\dfrac{8x^{13}}{6081075}+O(x^{15})$

$$ \Leftrightarrow  \sum_{k=0}^{\infty}\dfrac{(-1)(2x)^{2n+1}}{(2n+1)!}$$

Series representation of $\cos(2x)$

$\cos(x)=  1-\dfrac{x^2}{2!}+\dfrac{x^4}{4!}-\dfrac{x^6}{6!}+\dfrac{x^8}{8!}-\dfrac{x^{10}}{10!}+\dfrac{x^{12}}{12!}...$

$\cos(2x)=  1-\dfrac{(2x)^2}{2!}+\dfrac{(2x)^4}{4!}-\dfrac{(2x)^6}{6!}+\dfrac{(2x)^8}{8!}-\dfrac{(2x)^{10}}{10!}+\dfrac{(2x)^{12}}{12!}...$

$=1-\dfrac{4x^2}{2!}+\dfrac{16x^4}{4!}-\dfrac{64x^6}{6!}+\dfrac{256x^8}{8!}-\dfrac{(1024x)^{10}}{10!}+\dfrac{(4096x)^{12}}{12!}+...$

$=1-2x^2+\dfrac{2x^4}{3}-\dfrac{4x^6}{45}+\dfrac{2x^8}{315}-\dfrac{4x^{10}}{14175}+\dfrac{4x^{12}}{467775}+...$

$$\Leftrightarrow  \sum_{k=0}^{\infty}\dfrac{(-1)(2x)^{2n}}{(2n)!}$$

Series representation of $\tan(2x)$

$\tan(x)=x+\dfrac{x^3}{3}+\dfrac{2x^5}{15}+\dfrac{17x^7}{315}+\dfrac{62x^9}{2835}+\dfrac{1382x^{11}}{155925}...$

$\tan(2x)=2x+\dfrac{(2x)^3}{3}+\dfrac{2(2x)^5}{15}+\dfrac{17(2x)^7}{315}+\dfrac{62(2x)^9}{2835}+\dfrac{1382(2x)^{11}}{155925}...$

$=2x+\dfrac{8x^3}{3}+\dfrac{64x^5}{15}+\dfrac{2176x^7}{315}+\dfrac{31744x^9}{2835}+\dfrac{2830336x^{11}}{155925}...$

Dividing power series (2): More complicated examples

This thread will include more intricate long division problems. We start by deriving the power series for $\tan(x)$ and $\cot(x)$. It is easy to note that $\tan(x)$ and $\cot(x)$ can be obtained by using their very definition. $\tan(x)=\dfrac{\sin(x)}{\cos(x)}$ and $\cot(x)=\dfrac{\cos(x)}{\sin(x)}$. We first expand in series and then divide the two power series using the scheme of long division. This method, while simple, do not reveal the relationship between these two functions' coefficients and the Bernoulli numbers. We will illuminate this point in another thread where we seek to obtain the power series for the generating function of Bernoulli numbers. For now, we contend to just obtain the power series for $\tan(x)$ and $\cot(x)$.

Series representation of $\tan(x)$

Thus $\tan(x)=x+\dfrac{x^3}{3}+\dfrac{2x^5}{15}+\dfrac{17x^7}{315}+\dfrac{62x^9}{2835}+\dfrac{1382x^{11}}{155925}...$

Series representation of $\cot(x)$

The function is not defined at $x=0$, since $sin(0)=0$, division by zero is undefined. The function doesn't have a Maclaurin series centered at $0$. Nevertheless, we can still expand it into what is called the Laurent series. The Laurent series is a power series that includes negative degree.

Thus $\cot(x)=\dfrac{1}{x}-\dfrac{x}{3}-\dfrac{x^3}{45}-\dfrac{2x^5}{945}-\dfrac{x^7}{4725}-\dfrac{2x^9}{93555}...$

Series representation of $\sec(x)$

We use the identity $\sec(x)=\dfrac{1}{\cos(x)}$ to derive the Maclaurin series for $\sec(x)$.

Thus $\sec(x)=\color{green}{1}+\dfrac{\color{green}{1}x^2}{2!}+\dfrac{\color{green}{5}x^4}{24}+\dfrac{\color{green}{61}x^6}{720}+\dfrac{277x^8}{8064}+\dfrac{50521x^{10}}{3628800}...$

Long division may give us the series, but it doesn't hint at the fact that $\sec(x)$ is one of the two generating functions of Euler numbers. In fact, since we reduce fractions to their simplest form, this obscure the general formula for the coefficients of $\sec(x)$. The series of $\sec(x)$ is as followed:

$$\sum_{n=0}^{\infty}\dfrac{(-1)^{n}E_{2n}x^{2n}}{(2n)!}$$

The first few Euler numbers are:
$E_0=1$, $E_2=-1$, $E_4=5$, $E_6=-61$, $E_8=1385$, $E_{10}=-50521$, $E_{12}=2702765...$

Thus we can rewrite the series as followed:

$\sec(x)=\color{green}{1}+\dfrac{\color{green}{1}x^2}{2!}+\dfrac{\color{green}{5}x^4}{4!}+\dfrac{\color{green}{61}x^6}{6!}+\dfrac{\color{green}{1385}x^8}{8!}+\dfrac{\color{green}{50521}x^{10}}{10!}...$

Series representation of $\tanh(x)$ and sech(x)

Using the same method above, we can derive the series for $\tanh(x)$ and $\operatorname{sech(x)}$. The difference is that instead of being a positive term series, they become alternating series. The series for $\tanh(x)$ is:

$\tanh(x)=x-\dfrac{x^3}{3}+\dfrac{2x^5}{15}-\dfrac{17x^7}{315}+\dfrac{62x^9}{2835}-\dfrac{1382x^{11}}{155925}...$

The series for $sech$ is:

$\operatorname{sech}(x)=1-\dfrac{x^2}{2!}+\dfrac{5x^4}{24}-\dfrac{61x^6}{720}+\dfrac{277x^8}{8064}-\dfrac{50521x^{10}}{3628800}...$

$$\sum_{n=1}^{\infty}\dfrac{(-1)^nE_{2n}x^{2n}}{(2n)!}$$

Series representation of $\dfrac{x}{\sin(x)}$

At $x=0$, the function has the form $\dfrac{0}{0}$. Using L'Hopital rule to find the limit $$\lim_{x\to 0} \dfrac{x}{\sin(x)}$$, we have $$\lim_{x\to 0} \dfrac{1}{\cos(x)}$$, which is $1$. So the function is defined when $x=0$. By long division, we have:

Thus $\dfrac{x}{\sin(x)}=1+\dfrac{x^2}{3!}+\dfrac{7x^4}{360}+\dfrac{31x^6}{15120}+\dfrac{127x^8}{604800}+\dfrac{73x^{10}}{3421440}...$

Series representation of $\dfrac{1}{\sin(x)}=\csc(x)$

It is now easy to obtain the series representation for $\csc(x)$, we only have to divide it by $x$, the series is:

Thus $\csc(x)=\dfrac{1}{x}+\dfrac{x}{3!}+\dfrac{7x^3}{360}+\dfrac{31x^5}{15120}+\dfrac{127x^7}{604800}+\dfrac{73x^9}{3421440}...$

Again, the function is not defined at $x=0$, so there is no Maclaurin series for $\csc(x)$. What we obtain is the Laurent series.

Dividing power series (1): Long Division

Dividing power series is a a powerful method to obtain new series from known ones. In this thread, I will show some simple examples of dividing power series. We will start from the simplest example and move on the most intricate ones. The first example is that of a geometric series. The series for $\dfrac{1}{1-x}$ is worth learning by heart because it is ubiquitous in obtaining new power series. The scheme for dividing the series is represented below. This scheme is what we call long division of power series.

Series representation of $\dfrac{1}{1-x}$

Thus $\dfrac{1}{1-x}=1+x+x^2+x^3+x^4+x^5+x^6+...$

Series representation of $\dfrac{1}{1+x}$



Thus $\dfrac{1}{1+x}=1-x+x^2-x^3+x^4-x^5+x^6+...$

Series representation of $\dfrac{1}{1+2x}$


Thus $\dfrac{1}{1+2x}=1-2x+4x^2-8x^3+16x^4-32x^5+64x^6+...$

$=1-2x+2^2x^2-2^3x^3+2^4x^4-2^5x^5+2^6x^6+...$

Series representation of $\dfrac{1}{1+3x}$

Thus $\dfrac{1}{1+3x}=1-3x+9x^2-27x^3+81x^4-243x^5+729x^6+...$

$=1-3x+3^2x^2-3^3x^3+3^4x^4-3^5x^5+3^6x^6+...$

Series representation of $\dfrac{1}{1+4x}$

Thus $\dfrac{1}{1+4x}=1-4x+16x^2-64x^3+256x^4-1024x^5+4096x^6+...$

$=1-4x+4^2x^2-4^3x^3+4^4x^4-4^5x^5+4^6x^6+...$

Series of the form of $\dfrac{1}{1+kx}$

Here I will list the first 10 series in this form:

$\dfrac{1}{1+x}=1-x+x^2-x^3+x^4-x^5+x^6+...$

$\dfrac{1}{1+2x}=1-2x+2^2x^2-2^3x^3+2^4x^4-2^5x^5+2^6x^6+$

$\dfrac{1}{1+3x}=1-3x+3^2x^2-3^3x^3+3^4x^4-3^5x^5+3^6x^6+$

$\dfrac{1}{1+4x}=1-4x+4^2x^2-4^3x^3+4^4x^4-4^5x^5+4^6x^6+...$

$\dfrac{1}{1+5x}=1-5x+5^2x^2-5^3x^3+5^4x^4-5^5x^5+5^6x^6+...$

In general:

$\dfrac{1}{1+kx}=1-kx+k^2x^2-k^3x^3+k^4x^4-k^5x^5+k^6x^6+...$

We can insert fractional values to $k$ to obtain the inverse of these series:

$\dfrac{1}{1+\dfrac{1}{2}x}=\dfrac{2}{x+2}=1-\dfrac{x}{2}+\dfrac{x^2}{2^2}-\dfrac{x^3}{2^3}+\dfrac{x^4}{2^4}-\dfrac{x^5}{2^5}+\dfrac{x^6}{2^6}...$

$\dfrac{1}{1+\dfrac{1}{3}x}=\dfrac{3}{x+3}=1-\dfrac{x}{3}+\dfrac{x^2}{3^2}-\dfrac{x^3}{3^3}+\dfrac{x^4}{3^4}-\dfrac{x^5}{3^5}+\dfrac{x^6}{3^6}...$

$\dfrac{1}{1+\dfrac{1}{4}x}=\dfrac{4}{x+4}=1-\dfrac{x}{4}+\dfrac{x^2}{4^2}-\dfrac{x^3}{4^3}+\dfrac{x^4}{4^4}-\dfrac{x^5}{4^5}+\dfrac{x^6}{4^6}...$

$\dfrac{1}{1+\dfrac{1}{5}x}=\dfrac{5}{x+5}=1-\dfrac{x}{5}+\dfrac{x^2}{5^2}-\dfrac{x^3}{5^3}+\dfrac{x^4}{5^4}-\dfrac{x^5}{5^5}+\dfrac{x^6}{5^6}...$

Series of the form of $\dfrac{1}{1-kx}$

$\dfrac{1}{1-x}=1+x+x^2+x^3+x^4+x^5+x^6+...$

$\dfrac{1}{1-2x}=1+2x+2^2x^2+2^3x^3+2^4x^4+2^5x^5+2^6x^6+$

$\dfrac{1}{1-3x}=1+3x+3^2x^2+3^3x^3+3^4x^4+3^5x^5+3^6x^6+$

$\dfrac{1}{1-4x}=1+4x+4^2x^2+4^3x^3+4^4x^4+4^5x^5+4^6x^6+...$

$\dfrac{1}{1-5x}=1+5x+5^2x^2+5^3x^3+5^4x^4+5^5x^5+5^6x^6+...$

In general

$\dfrac{1}{1-kx}=1+kx+k^2x^2+k^3x^3+k^4x^4+k^5x^5+k^6x^6+...$

Multiplying power series (2): Cauchy product

Given two power series:


$A= a_0+a_1x+a_2x^2+a_3x^3+a_4x^4+...$

$B= b_0+b_1x+b_2x^2+b_3x^3+b_4x^4+...$

The Cauchy product of two power series are defined as below:

$A\cdot B= a_0b_0+(a_0b_1+a_1b_0)x+(a_0b_2+a_1b_1+a_2b_0)x^2+...$
$(a_0b_3+a_1b_2+a_2b_1+a_3b_0)x^3+(a_0b_4+a_1b_3+a_2b_2+a_3b_1+a_4b_0)x^4$

From here, we can construct the "Cauchy triangle" to exhaustively multiply the coefficients of two power series. We simply collect and group terms that is multiplied with the same degree of $x$. The result is the triangle below:



$[x^0]a_0b_0$

$[x^1]a_0b_1+a_1b_0$

$[x^2]a_0b_2+a_1b_1+a_2b_0$

$[x^3]a_0b_3+a_1b_2+a_2b_1+a_3b_0$

$[x^4]a_0b_4+a_1b_3+a_2b_2+a_3b_1+a_4b_0$

$[x^5]a_0b_5+a_1b_4+a_2b_3+a_3b_2+a_4b_1+a_5b_0$

$[x^6]a_0b_6+a_1b_5+a_2b_4+a_3b_3+a_4b_2+a_5b_1+a_6b_0$

$[x^7]a_0b_7+a_1b_6+a_2b_5+a_3b_4+a_4b_3+a_5b_2+a_6b_1+a_7b_0$

$[x^8]a_0b_8+a_1b_7+a_2b_6+a_3b_5+a_4b_4+a_5b_3+a_6b_2+a_7b_1+a_8b_0$

$[x^9]a_0b_9+a_1b_8+a_2b_7+a_3b_6+a_4b_5+a_5b_4+a_6b_3+a_7b_2+a_8b_1+a_9b_0$

$[x^{10}]a_0b_10+a_1b_9+a_2b_8+a_3b_7+a_4b_6+a_5b_5+a_6b_4+a_7b_3+a_8b_2+a_9b_1+a_{10}b_0$

This method of multiplying series avoid the issue of misalignment of the long multiplication technique. It can be generalized to form the method of indeterminate coefficients, which I will introduce in another post.

Series representations for $\sin^2(x)$

To obtain the series for this function, rewrite $\sin^2(x)$ as $\sin(x)\cdot\sin(x)$. Let $a_n$ denotes the coefficients of the first $\sin(x)$ and $b_n$ denotes the coefficieints of $\sin(x)$. We notice that $\sin(x)$ is an odd function, therefore, all even terms are going to be $0$. The coeffcients are:

$a_0=0; b_0=0$

$a_1=1; b_1=1$

$a_3=-\dfrac{1}{3!}; b_3=-\dfrac{1}{3!}$

$a_5=\dfrac{1}{5!}; b_5=\dfrac{1}{5!}$

$a_7=-\dfrac{1}{7!}; b_7=-\dfrac{1}{7!}$

$a_9=\dfrac{1}{9!}; b_9=\dfrac{1}{9!}$

$a_{11}=-\dfrac{1}{11!}; b_{11}=-\dfrac{1}{11!}$

Notice that $sin^2(x)$ is an even function. Therefore, all odd terms are going to be $0$. If we apply the Cauchy triangle, we will have:

$[x^0]a_0b_0$

$[x^0]=0\cdot0=0$

$[x^2]a_0b_2+a_1b_1+a_2b_0$

$[x^2]=0\cdot\left(-\dfrac{1}{3!}\right)+1\cdot1 \left(-\dfrac{1}{3!}\right)\cdot 0 =1$

$[x^4]a_0b_4+a_1b_3+a_2b_2+a_3b_1+a_4b_0$

$[x^4]=0+\left(-\dfrac{1}{3!}\right)+0+\left(-\dfrac{1}{3!}\right)+0=-\dfrac{1}{3}$

$[x^6]a_0b_6+a_1b_5+a_2b_4+a_3b_3+a_4b_2+a_5b_1+a_6b_0$

$[x^6]=0+\left(\dfrac{1}{5!}\right)+0+\left(-\dfrac{1}{3!}\right)\left(-\dfrac{1}{3!}\right)+0+\dfrac{1}{5!}=\dfrac{2}{45}$

$[x^8]a_0b_8+a_1b_7+a_2b_6+a_3b_5+a_4b_4+a_5b_3+a_6b_2+a_7b_1+a_8b_0$

$[x^8]=0+\left(-\dfrac{1}{7!}\right)+0+\left(-\dfrac{1}{3!}\right)\left(\dfrac{1}{5!}\right)+0+\left(\dfrac{1}{5!}\right)\left(-\dfrac{1}{3!}\right)+0+\left(-\dfrac{1}{7!}\right)=-\dfrac{1}{315}$

$[x^{10}]a_0b_10+a_1b_9+a_2b_8+a_3b_7+a_4b_6+a_5b_5+a_6b_4+a_7b_3+a_8b_2+a_9b_1+a_{10}b_0$

$[x^{10}]= 0+\left(\dfrac{1}{9!}\right)+0+\left(-\dfrac{1}{3!}\right)\left(-\dfrac{1}{7!}\right)+0+\left(\dfrac{1}{5!}\right)\left(\dfrac{1}{5!}\right)+0+\left(-\dfrac{1}{7!}\right)\left(-\dfrac{1}{3!}\right)+0$
$+\dfrac{1}{9!}=\dfrac{2}{14175}$

$[x^{12}]a_0b_{12}+a_1b_{11}+a_2b_{10}+a_3b_9+a_4b_8+a_5b_7+a_6b_6+a_7b_5+a_8b_4+$

$a_9b_3+a_{10}b_2+a_{11}b_1+a_{12}b_0$

$[x^{12}]= 0+\left(-\dfrac{1}{11!}\right)+0+\left(-\dfrac{1}{3!}\right)\left(\dfrac{1}{9!}\right)+0+\left(\dfrac{1}{5!}\right)\left(-\dfrac{1}{7!}\right)+0+\left(\dfrac{1}{7!}\right)\left(-\dfrac{1}{3!}\right)+0+$

$\left(\dfrac{1}{9!}\right)\left(-\dfrac{1}{3!}\right)-\dfrac{1}{11!}=-\dfrac{2}{467775}$

So we are finally able to derive the series representation for $\sin^2(x)$:

$\sin^2(x)=x^2-\dfrac{1}{3}x^4+\dfrac{2}{45}x^6-\dfrac{1}{315}x^8+\dfrac{2}{14715}x^{10}-\dfrac{2}{467775}x^{12}+O(x^{14})$

Series representations for $\cos^2(x)$

Since $\cos(x)$ is an even function, all odd terms are zero. The coefficients are:


$a_0=1; b_0=1$

$a_2=-\dfrac{1}{2!}; b_2=-\dfrac{1}{2!}$

$a_4=\dfrac{1}{4!}; b_4=\dfrac{1}{4!}$

$a_6=-\dfrac{1}{6!}; b_6=-\dfrac{1}{6!}$

$a_8=\dfrac{1}{8!}; b_8=\dfrac{1}{8!}$

$a_{12}=-\dfrac{1}{12!}; b_{12}=-\dfrac{1}{12!}$

Notice that $\cos^2(x)$ is an even function. Therefore, all odd terms are going to be $0$. If we apply the Cauchy triangle, we will have:

$[x^0]a_0b_0$

$[x_0]=1\cdot1=1$

$[x^2]a_0b_2+a_1b_1+a_2b_0$

$[x^2]=-\dfrac{1}{2!}+0-\dfrac{1}{2!}\cdot 0 =-1$

$[x^4]a_0b_4+a_1b_3+a_2b_2+a_3b_1+a_4b_0$

$[x^4]=\dfrac{1}{4!}+0+\left(-\dfrac{1}{2!}\right)\left(-\dfrac{1}{2!}\right)+0+\dfrac{1}{4!}=\dfrac{1}{3}$

$[x^6]a_0b_6+a_1b_5+a_2b_4+a_3b_3+a_4b_2+a_5b_1+a_6b_0$

$[x^6]=-\dfrac{1}{6!}+0+\left(-\dfrac{1}{2!}\right)\left(-\dfrac{1}{6!}\right)+0+\left(\dfrac{1}{4!}\right)\left(-\dfrac{1}{2!}\right)+0+\left(-\dfrac{1}{6!}\right)=-\dfrac{2}{45}$

$[x^8]a_0b_8+a_1b_7+a_2b_6+a_3b_5+a_4b_4+a_5b_3+a_6b_2+a_7b_1+a_8b_0$

$[x^8]=\dfrac{1}{8!}+0+\left(-\dfrac{1}{2!}\right)\left(-\dfrac{1}{6!}\right)+0+\left(\dfrac{1}{4!}\right)\left(\dfrac{1}{4!}\right)+0+\left(-\dfrac{1}{6!}\right)\left(-\dfrac{1}{2!}\right)+0+\dfrac{1}{8!}$
$=\dfrac{1}{315}$

$[x^{10}]a_0b_10+a_1b_9+a_2b_8+a_3b_7+a_4b_6+a_5b_5+a_6b_4+a_7b_3+a_8b_2+a_9b_1+a_{10}b_0$

$[x^{10}]= -\dfrac{1}{10!}+0+\left(-\dfrac{1}{2!}\right)\left(\dfrac{1}{8!}\right)+0+\left(\dfrac{1}{4!}\right)\left(-\dfrac{1}{6!}\right)+0+\left(-\dfrac{1}{6!}\right)\left(\dfrac{1}{4!}\right)+0$
$+\left(\dfrac{1}{8!}\right)\left(-\dfrac{1}{2!}\right)+0-\dfrac{1}{10}=-\dfrac{2}{14175}$

$[x^{12}]a_0b_{12}+a_1b_{11}+a_2b_{10}+a_3b_9+a_4b_8+a_5b_7+a_6b_6+a_7b_5+a_8b_4+$
$a_9b_3+a_{10}b_2+a_{11}b_1+a_{12}b_0$

$[x^{12}]= \dfrac{1}{12!}+0+\left(-\dfrac{1}{2!}\right)\left(-\dfrac{1}{10!}\right)+0+\left(\dfrac{1}{4!}\right)\left(\dfrac{1}{8!}\right)+0+\left(-\dfrac{1}{6!}\right)\left(-\dfrac{1}{6!}\right)+0$
$+\left(\dfrac{1}{8!}\right)\left(\dfrac{1}{4!}\right)+0+\left(-\dfrac{1}{10!}\right)\left(-\dfrac{1}{2!}\right)+\dfrac{1}{12!}=\dfrac{2}{467775}$

So we are finally able to derive the series representation for $\cos^2(x)$:


$\cos^2(x)=1-x^2+\dfrac{1}{3}x^4-\dfrac{2}{45}x^6+\dfrac{1}{315}x^8-\dfrac{2}{14715}x^{10}+\dfrac{2}{467775}x^{12}+O(x^{14})$

If we add $\sin^2(x)+\cos^2(x)$, we will have:

$\color{red}{x^2-\dfrac{1}{3}x^4+\dfrac{2}{45}x^6-\dfrac{1}{315}x^8+\dfrac{2}{14715}x^{10}-\dfrac{2}{467775}x^{12}+}...$
$+1\color{red}{-x^2+\dfrac{1}{3}x^4-\dfrac{2}{45}x^6+\dfrac{1}{315}x^8-\dfrac{2}{14715}x^{10}+\dfrac{2}{467775}x^{12}+}=1$

Red terms denote elimination

This gives us the familiar identity $\color{green}{\sin^2(x)+\cos^2(x)=1}$ 

Series representation for $\sinh^2(x)$ and $\cosh^2(x)$

The Maclaurin series for $\sinh^2(x)$ and $\cosh^2(x)$ are going to be very similar to $\sin^2(x)$ and $\cos^2(x)$, except that the signs are all positive. We can derive the series using the same method that we did for $\sin^2(x)$. This is left to the readers as an excercise.

$\sinh^2(x)=x^2+\dfrac{1}{3}x^4+\dfrac{2}{45}x^6+\dfrac{1}{315}x^8+\dfrac{2}{14715}x^{10}+\dfrac{2}{467775}x^{12}+O(x^{14})$

$\cosh^2(x)=1+x^2+\dfrac{1}{3}x^4+\dfrac{2}{45}x^6+\dfrac{1}{315}x^8+\dfrac{2}{14715}x^{10}+\dfrac{2}{467775}x^{12}+O(x^{14})$

Subtracting $\cosh^2(x)$ from $\sinh^2(x)$, we will have:

$1+\color{red}{x^2+\dfrac{1}{3}x^4+\dfrac{2}{45}x^6+\dfrac{1}{315}x^8+\dfrac{2}{14715}x^{10}+\dfrac{2}{467775}x^{12}+}...-$
$\color{red}{x^2-\dfrac{1}{3}x^4-\dfrac{2}{45}x^6-\dfrac{1}{315}x^8-\dfrac{2}{14715}x^{10}-\dfrac{2}{467775}x^{12}}...=1$


So we obtain the familiar identity: $\color{green}{\cosh^2(x)-\sinh^2(x)=1}$

Multiplying power series (1): Long multiplication

We can set out to multiply power series the same way we do with polynomials, numbers or fractions. We will first introduce the scheme of long multiplication and its difficulty, then we will move on to define the Cauchy products of two power series. The latter method has the advantage of correcting the misalignment of the former.

Series representation for $e^x\sin(x)$

We know that

$e^x= 1+x+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^5}{5!}+\dfrac{x^6}{6!}+\dfrac{x^7}{7!}+\dfrac{x^{8}}{8!}+\dfrac{x^{9}}{9!}+\dfrac{x^{10}}{10!}+O(x^{11})$

$\sin(x)=  x-\dfrac{x^3}{3!}+\dfrac{x^5}{5!}-\dfrac{x^7}{7!}+\dfrac{x^9}{9!}-\dfrac{x^{11}}{11!}+\dfrac{x^{13}}{13!}-\dfrac{x^{15}}{15!}+\dfrac{x^{17}}{17!}+O(x^{19})$

\begin{equation}
\frac{
    \frac{
        \begin{array}[b]{r}
                1+x+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^5}{5!}+\dfrac{x^6}{6!}+\dfrac{x^7}{7!}+\dfrac{x^{8}}{8!}+\dfrac{x^{9}}{9!}+\dfrac{x^{10}}{10!}...    \\
            \times~~~  x-\dfrac{x^3}{3!}+\dfrac{x^5}{5!}-\dfrac{x^7}{7!}+\dfrac{x^9}{9!}-\dfrac{x^{11}}{11!}+\dfrac{x^{13}}{13!}-\dfrac{x^{15}}{15!}+\dfrac{x^{17}}{17!}...
        \end{array}
        }
        {
    \begin{array}[b]{r}
        x+x^2+\dfrac{x^{3}}{2!}\color{red}{+\dfrac{x^{4}}{3!}}+\dfrac{x^{5}}{4!}+\dfrac{x^{6}}{5!}+\dfrac{x^{7}}{6!}\color{red}{+\dfrac{x^{8}}{7!}}+\dfrac{x^{9}}{8!}~~~~~~~~~~~~~~~   \\
        ~~-\dfrac{x^{3}}{3!}\color{red}{-\dfrac{x^{4}}{3!}}-\dfrac{x^{5}}{3!2!}-\dfrac{x^{6}}{3!3!}-\dfrac{x^{7}}{3!4!}\color{red}{-\dfrac{x^{8}}{3!5!}}-\dfrac{x^{9}}{3!6}~~    \\
        ~~~    \\
         \dfrac{x^{5}}{5!}+\dfrac{x^{6}}{5!}+\dfrac{x^{7}}{2!5!}\color{red}{+\dfrac{x^{8}}{3!5!}}+\dfrac{x^{9}}{2!7!} \\
          -\dfrac{x^{7}}{7!}\color{red}{-\dfrac{x^{8}}{7!}}-\dfrac{x^{9}}{2!7!}\\
    \end{array}
    }
}
{
x+x^2+\dfrac{x^3}{3}-0-\dfrac{x^5}{30}-\dfrac{x^6}{90}-\dfrac{x^7}{630}-0+\dfrac{x^9}{22680}
}
\end{equation}

Terms in red are those that are totally eliminated

$e^x\sin(x)=x+x^2+\dfrac{x^3}{3}-\dfrac{x^5}{30}-\dfrac{x^6}{90}-\dfrac{x^7}{630}+\dfrac{x^9}{22680}...$

Series representation for $e^x\cos(x)$

Similarly, we know that

$e^x= 1+x+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+\dfrac{x^6}{6!}+\dfrac{x^{7}}{7!}+\dfrac{x^{8}}{8!}+\dfrac{x^{9}}{9!}++\dfrac{x^{10}}{10!}+O(x^{11})$

$\cos(x)=  1-\dfrac{x^2}{2!}+\dfrac{x^4}{4!}-\dfrac{x^6}{6!}+\dfrac{x^8}{8!}-\dfrac{x^{10}}{10!}+\dfrac{x^{12}}{12!}-\dfrac{x^{14}}{14!}+\dfrac{x^{16}}{16!}+O(x^{18})$


\begin{equation}
\frac{
    \frac{
        \begin{array}[b]{r}
                1+x+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+\dfrac{x^6}{6!}+\dfrac{x^{7}}{7!}+\dfrac{x^{8}}{8!}+\dfrac{x^{9}}{9!}+\dfrac{x^{10}}{10!}...    \\
            \times~~~ 1-\dfrac{x^2}{2!}+\dfrac{x^4}{4!}-\dfrac{x^6}{6!}+\dfrac{x^8}{8!}-\dfrac{x^{10}}{10!}+\dfrac{x^{12}}{12!}-\dfrac{x^{14}}{14!}+\dfrac{x^{16}}{16!}...
        \end{array}
        }
        {
    \begin{array}[b]{r}
       1+x\color{red}{+\dfrac{x^2}{2!}}+\dfrac{x^3}{3!}+\dfrac{x^5}{5!}\color{red}{+\dfrac{x^6}{6!}}+\dfrac{x^7}{7!}+\dfrac{x^{8}}{8!}+\dfrac{x^{9}}{9!}+\dfrac{x^{10}}{10!}...   \\
        +~~\color{red}{-\dfrac{x^{2}}{2!}}-\dfrac{x^{3}}{2!}-\dfrac{x^{4}}{2!2!}-\dfrac{x^{5}}{2!3!}\color{red}{-\dfrac{x^{6}}{2!4!}}-\dfrac{x^{7}}{2!5!}-\dfrac{x^{8}}{2!6!}~~    \\
        ~~~    \\
         \dfrac{x^{4}}{4!}+\dfrac{x^{5}}{4!}\color{red}{+\dfrac{x^{6}}{2!4!}}+\dfrac{x^{7}}{3!4!}+\dfrac{x^{8}}{4!4!} \\
          \color{red}{-\dfrac{x^{6}}{6!}}-\dfrac{x^{7}}{6!}-\dfrac{x^{8}}{2!6!}\\
           \dfrac{x^{8}}{8!} ~\\
    \end{array}
    }
}
{
1+x+0-\dfrac{x^3}{3}-\dfrac{x^4}{6}-\dfrac{x^5}{30}-0+\dfrac{x^7}{630}+\dfrac{x^8}{2520}
...}

\end{equation}

$e^x\cos(x)=1+x-\dfrac{x^3}{3}-\dfrac{x^4}{6}-\dfrac{x^5}{30}+\dfrac{x^7}{630}+\dfrac{x^8}{2520}+...$

Series representation for $\sin(x)\cos(x)$


\begin{equation}
\frac{
    \frac{
        \begin{array}[b]{r}
                1-\dfrac{x^2}{2!}+\dfrac{x^4}{4!}-\dfrac{x^6}{6!}+\dfrac{x^8}{8!}-\dfrac{x^{10}}{10!}+\dfrac{x^{12}}{12!}-\dfrac{x^{14}}{14!}+\dfrac{x^{16}}{16!}...    \\
            \times~~~ x-\dfrac{x^3}{3!}+\dfrac{x^5}{5!}-\dfrac{x^7}{7!}+\dfrac{x^9}{9!}-\dfrac{x^{11}}{11!}+\dfrac{x^{13}}{13!}-\dfrac{x^{15}}{15!}+\dfrac{x^{17}}{17!}...
        \end{array}
        }
        {
    \begin{array}[b]{r}
       x-\dfrac{x^3}{2!}+\dfrac{x^5}{3!}-\dfrac{x^7}{7!}+\dfrac{x^9}{8!}-\dfrac{x^{11}}{10!}+\dfrac{x^{13}}{12!}-\dfrac{x^{15}}{14!}+\dfrac{x^{17}}{16!}...   \\
        +~~-\dfrac{x^{3}}{3!}+\dfrac{x^{5}}{2!3!}-\dfrac{x^{7}}{3!4!}+\dfrac{x^{9}}{3!6!}-\dfrac{x^{11}}{3!8!}+\dfrac{x^{13}}{3!10!}-\dfrac{x^{15}}{3!12!}+\dfrac{x^{17}}{3!14!}~~    \\
        ~~~    \\
         \dfrac{x^{5}}{5!}-\dfrac{x^{7}}{2!5!}+\dfrac{x^{9}}{4!5!}-\dfrac{x^{11}}{5!6!}+\dfrac{x^{13}}{5!8!}-\dfrac{x^{15}}{5!10!}+\dfrac{x^{17}}{5!12!} \\
          -\dfrac{x^{7}}{7!}+\dfrac{x^{9}}{2!7!}-\dfrac{x^{11}}{4!7!}+\dfrac{x^{13}}{6!7!}-\dfrac{x^{15}}{7!8!}+\dfrac{x^{17}}{7!10!}\\
           \dfrac{x^{9}}{9!}-\dfrac{x^{11}}{2!9!}+\dfrac{x^{13}}{4!9!}-\dfrac{x^{15}}{6!9!}+\dfrac{x^{17}}{8!9!}~~\\
           -\dfrac{x^{11}}{11!}+\dfrac{x^{13}}{2!11!}-\dfrac{x^{15}}{4!11!}+\dfrac{x^{17}}{6!11!}~~\\
             \dfrac{x^{13}}{13!}-\dfrac{x^{15}}{2!13!}+\dfrac{x^{17}}{4!13!}~~\\
             -\dfrac{x^{15}}{15!}+\dfrac{x^{17}}{2!15!}~~\\
             \dfrac{x^{17!}}{17!}
\end{array}
    }
}
{
x-\dfrac{2x^3}{3}+\dfrac{2x^5}{15}-\dfrac{4x^7}{315}+\dfrac{2x^9}{2835}-\dfrac{4x^{11}}{155925}+\dfrac{4x^{13}}{6081075}-\dfrac{8x^{15}}{638512875}+\dfrac{2x^{17}}{10854718875}
}

\end{equation}

$\sin(x)\cos(x)=x-\dfrac{2x^3}{3}+\dfrac{2x^5}{15}-\dfrac{4x^7}{315}+\dfrac{2x^9}{2835}-\dfrac{4x^{11}}{155925}+\dfrac{4x^{13}}{6081075}-\dfrac{8x^{15}}{638512875}+....$

From here we can calculate the series for $2\sin(x)\cos(x)=\sin(2x)$. Admittedly this can be achieved easier by using the method of substitution, but we derive the series just for convenience.

$2\sin(x)\cos(x)=2\left(x-\dfrac{2x^3}{3}+\dfrac{2x^5}{15}-\dfrac{4x^7}{315}+\dfrac{2x^9}{2835}-\dfrac{4x^{11}}{155925}+\dfrac{4x^{13}}{6081075}-\dfrac{8x^{15}}{638512875}+\right)....$

$\sin(2x)=2x-\dfrac{4x^3}{3}+\dfrac{4x^5}{15}-\dfrac{8x^7}{315}+\dfrac{4x^9}{2835}-\dfrac{8x^{11}}{155925}+\dfrac{8x^{13}}{6081075}-\dfrac{16x^{15}}{638512875}+....$

Weakness of long multiplication method:

The weakness of long multiplication is that when we multply two power series, their terms may not be well aligned, which make computation harder and messier.

Consider the following example. We simply switch the arrangement of $e^x\cos(x)$:


\begin{equation}
\frac{
    \frac{
        \begin{array}[b]{r}
                 1-\dfrac{x^2}{2!}+\dfrac{x^4}{4!}-\dfrac{x^6}{6!}+\dfrac{x^8}{8!}-\dfrac{x^{10}}{10!}+\dfrac{x^{12}}{12!}-\dfrac{x^{14}}{14!}+\dfrac{x^{16}}{16!}....    \\
            \times~~~ 1+x+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^5}{5!}+\dfrac{x^6}{6!}+\dfrac{x^7}{7!}+\dfrac{x^{8}}{8!}+\dfrac{x^{9}}{9!}+\dfrac{x^{10}}{10!}

...
        \end{array}
        }
        {
    \begin{array}[b]{r}
       1-\dfrac{x^2}{2!}+\dfrac{x^4}{4!}-\dfrac{x^6}{6!}+\dfrac{x^8}{8!}-\dfrac{x^10}{10!}+\dfrac{x^{12}}{12!}-\dfrac{x^{14}}{14!}+\dfrac{x^{16}}{16!}...   \\
        +~~\color{green}{x-\dfrac{x^{3}}{2!}+\dfrac{x^{5}}{4!}-\dfrac{x^{7}}{6!}+\dfrac{x^{9}}{8!}-\dfrac{x^{11}}{10!}+\dfrac{x^{13}}{12!}-\dfrac{x^{15}}{15!}+\dfrac{x^{17}}{16!}~~}    \\
        ~~~    \\
         \dfrac{x^{2}}{2!}+\dfrac{x^{4}}{2!2!}+\dfrac{x^{6}}{2!4!}+\dfrac{x^{8}}{2!6!}+\dfrac{x^{10}}{2!8!}-\dfrac{x^{12}}{2!10!}+\dfrac{x^{14}}{2!12!} \\
\end{array}
    }
}
{
}

\end{equation}


The line that is colored in green gets in the way of our computation. The terms are not well-aligned, making calculation harder than it should be. For this reason, in the next article, I will introduce a method of multiplying two power series without setting out the scheme of long multiplication. This method is called the Cauchy product.

Adding and subtracting power series

We can add and subtract power series the same way we do with numbers, fractions or polynomials. I wish to re-derive the Maclaurin series for $\sinh(x)$ and $\cosh(x)$ to illustrate this point.

We can use the definition of $\sinh(x)$ and $\cosh(x)$ as followed

Series representation of $\sinh(x)$:

$\sinh(x)=\dfrac{e^x-e^{-x}}{2}$

We know the series representation for $e^x$:

$ e^x=1+\dfrac{x}{1!}+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+\dfrac{x^6}{6!}+O(x^7)$

Replace $x$ by $-x$, we have:

$e^{-x}=1-\dfrac{x}{1!}+\dfrac{x^2}{2!}-\dfrac{x^3}{3!}+\dfrac{x^4}{4!}-\dfrac{x^5}{5!}+\dfrac{x^6}{6!}-O(x^7)$

$\sinh(x)=\dfrac{1}{2}\left[1+\dfrac{x}{1!}+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+...-\left(1-\dfrac{x}{1!}+\dfrac{x^2}{2!}-\dfrac{x^3}{3!}+\dfrac{x^4}{4!}-\dfrac{x^5}{5!}+...\right)\right]$

$=\dfrac{1}{2}\left(1+\dfrac{x}{1!}\color{red}{+\dfrac{x^2}{2!}}+\dfrac{x^3}{3!}\color{red}{+\dfrac{x^4}{4!}}+\dfrac{x^5}{5!}+...-1+\dfrac{x}{1!}\color{red}{-\dfrac{x^2}{2!}}+\dfrac{x^3}{3!}\color{red}{-\dfrac{x^4}{4!}}+\dfrac{x^5}{5!}-...\right)$

Red terms denote elimination

$=\dfrac{2x}{2\cdot 1!}+\dfrac{2x^3}{2\cdot 3!}+\dfrac{2x^5}{2\cdot 5!}+\dfrac{2x^7}{2\cdot 7!}+\dfrac{2x^9}{2\cdot 9!}+O(x^{11})$

$=x+\dfrac{x^3}{3!}+\dfrac{x^5}{5!}+\dfrac{x^7}{7!}+\dfrac{x^9}{9!}+\dfrac{x^{11}}{11!}+\dfrac{x^{13}}{13!}+O(x^{11})$

Series representation of $\cosh(x)$:

$\cosh(x)=\dfrac{e^x+e^{-x}}{2}$

$\cosh(x)=\dfrac{1}{2}\left[1+\dfrac{x}{1!}+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+...+\left(1-\dfrac{x}{1!}+\dfrac{x^2}{2!}-\dfrac{x^3}{3!}+\dfrac{x^4}{4!}-\dfrac{x^5}{5!}+...\right)\right]$

$=\dfrac{1}{2}\left(1\color{red}{+\dfrac{x}{1!}}+\dfrac{x^2}{2!}\color{red}{+\dfrac{x^3}{3!}}+\dfrac{x^4}{4!}\color{red}{+\dfrac{x^5}{5!}}+...+1\color{red}{-\dfrac{x}{1!}}+\dfrac{x^2}{2!}\color{red}{-\dfrac{x^3}{3!}}+\dfrac{x^4}{4!}\color{red}{-\dfrac{x^5}{5!}}+...\right)$

$=\dfrac{2}{2}+\dfrac{2x^2}{2\cdot 2!}+\dfrac{2x^4}{2\cdot 4!}+\dfrac{2x^6}{2\cdot 6!}+\dfrac{2x^8}{2\cdot 8!}+\dfrac{2x^{10}}{2\cdot 10!}+O(x^{12})$

$=1+\dfrac{x^2}{2!}+\dfrac{x^4}{4!}+\dfrac{x^6}{6!}+\dfrac{x^8}{8!}+\dfrac{x^{10}}{10!}+\dfrac{x^{12}}{12!}+O(x^{14})$

We can try a few more examples to get the gist of these methods:

Series representation of $e^x+\sin(x)$:

$e^x+\sin(x)=\left(1+\dfrac{x}{1!}+\dfrac{x^2}{2!}\color{red}{+\dfrac{x^3}{3!}}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+...\right)+\left(x\color{red}{-\dfrac{x^3}{3!}}+\dfrac{x^5}{5!}-\dfrac{x^7}{7!}+\dfrac{x^9}{9!}...\right)$

$=1+2x+\dfrac{x^2}{2!}+\dfrac{x^4}{4!}+\dfrac{2x^5}{5!}+\dfrac{x^6}{6!}+\dfrac{x^8}{8!}+\dfrac{2x^9}{9!}+\dfrac{x^{10}}{10!}+\dfrac{x^{12}}{12!}...$

Series representation of $e^x+\cos(x)$:

$e^x+\cos(x)=\left(1+\dfrac{x}{1!}\color{red}{+\dfrac{x^2}{2!}}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+...\right)+\left(1\color{red}{-\dfrac{x^2}{2!}}+\dfrac{x^4}{4!}-\dfrac{x^6}{6!}+\dfrac{x^8}{8!}...\right)$

$=2+\dfrac{x^3}{3!}+\dfrac{2x^4}{4!}+\dfrac{x^5}{5!}+\dfrac{x^7}{7!}+\dfrac{2x^8}{8!}+\dfrac{x^{9}}{9!}+\dfrac{x^{11}}{11!}...$

Series representation of $e^x-\sin(x)$:

$e^x-\sin(x)=\left(1+\dfrac{x}{1!}+\dfrac{x^2}{2!}\color{red}{+\dfrac{x^3}{3!}}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+...\right)-\left(x\color{red}{-\dfrac{x^3}{3!}}+\dfrac{x^5}{5!}-\dfrac{x^7}{7!}+\dfrac{x^9}{9!}...\right)$

$=\left(1\color{red}{+\dfrac{x}{1!}}+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}\color{red}{+\dfrac{x^5}{5!}}+...\right)\color{red}{-x}+\dfrac{x^3}{3!}\color{red}{-\dfrac{x^5}{5!}}+\dfrac{x^7}{7!}-\dfrac{x^9}{9!}...$

$=1+\dfrac{x^2}{2!}+\dfrac{2x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^6}{6!}+\dfrac{2x^7}{7!}+\dfrac{x^8}{8!}...$

Series representation of $e^x-\cos(x)$:

$e^x-\cos(x)=\left(1+\dfrac{x}{1!}+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+...\right)-\left(1-\dfrac{x^2}{2!}+\dfrac{x^4}{4!}-\dfrac{x^6}{6!}+\dfrac{x^8}{8!}...\right)$

$=\left(\color{red}{1}+\dfrac{x}{1!}+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}\color{red}{+\dfrac{x^4}{4!}}+\dfrac{x^5}{5!}+...\right)\color{red}{-1}+\dfrac{x^2}{2!}\color{red}{-\dfrac{x^4}{4!}}+\dfrac{x^6}{6!}-\dfrac{x^8}{8!}...$

$=x+\dfrac{2x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^5}{5!}+\dfrac{2x^6}{6!}+\dfrac{x^7}{7!}+\dfrac{x^{9}}{9!}+\dfrac{2x^{10}}{10!}...$


The last example involved two functions that we haven't yet derived since the last post. We will do this later. The series is beautiful in its own right and deserve a place on our blog:

Series representation of $\ln(1-x)+\dfrac{1}{1-x}$:

$$\ln(1-x)=-x-\dfrac{x^2}{2}-\dfrac{x^3}{3}-\dfrac{x^4}{4}-\dfrac{x^5}{5}-O(x^6)=-\sum_{n=1}^{+\infty}\frac{x^n}{n}$$

$$\dfrac{1}{1-x}=1+x+x^2+x^3+x^4+x^5+O(x^6)=1+\sum_{n=1}^{+\infty}x^n$$

$\ln(1-x)+\dfrac{1}{1-x}=1+(-x+x)+(-\dfrac{x^2}{2}+x^2)+(-\dfrac{x^3}{3}+x^3)+(-\dfrac{x^4}{4}+x^4)...$

$$=1+\dfrac{1}{2}x^2+\dfrac{2}{3}x^3+\dfrac{3}{4}x^4+\dfrac{4}{5}x^5+\dfrac{5}{6}x^6+\dfrac{6}{7}x^7+O(x^8) = 1+\sum_{n=0}^\infty\frac{n}{n+1}x^{n+1}$$

or $$-\sum_{n=1}^{+\infty}\frac{x^n}{n}+1+\sum_{n=1}^{+\infty}x^n=1+\sum_{n=1}^{+\infty}\left(x^n-\frac{x^n}{n}\right)=1+\sum_{n=1}^{+\infty}(1-\frac 1n)x^n$$

A note on the Taylor and Maclaurin formula

Of the name of Taylor series:

Colin Maclaurin credited Brook Taylor and his work "Methodus Incrementorum" (published in 1715) for the discovery of this series, even though it is already known to earlier generation of mathematicians such as Newton. This reference can be found in book II of his work "A Treatise on Fluxion", page 611. He wrote the series as:
$y=E+\dot E+ \dfrac{\ddot E}{2}+\dfrac{\dddot E}{6}+\dfrac{\ddddot E}{24}+etc$

where $\dot E$, $\ddot E$, $\dddot E$, $\ddddot E$ are Newton's notation for the derivatives of a function (fluxions).

On the Taylor-Maclaurin formula

The definition of a power series is a series of the form:
$$\boxed{a_0+a_1(x-c)+a_2(x-c)^2+a_3(x-c)^3+a_4(x-c)^4+...=\sum_{n=0}^{+\infty}a_n(x-c)^{n}}$$
where $a_n$ is the coefficient of the power series.
A Taylor series is a special form of power series where the coefficients are $\dfrac{f^{(n)}(c)}{n!}$, or the $n$ order derivative of $f(x)$ over $n!$.

The coefficient $a_n$ cannot be dependent on $x$, a series such as this is not a power series:
$$\sin(x)x+\sin(2x)x^2+\sin(3x)x^3+\sin(4x)x^4=\sum_{n=1}^{+\infty}\sin(nx)x^n$$

We can derive the Taylor formula by successively differentiate the infinite polynomials below.

Assume that the function $f(x)$ admits the power series representation, it has the form:

$$f(x)=a_0+a_1(x-c)+a_2(x-c)^2+a_3(x-c)^3+a_4(x-c)^4+...\tag{1}$$

We wish to determine the coefficients $a_n$. We can successively differentiate the power series given above:

$$f'(x)=0+1\cdot a_1+2 a_2(x-c)+3a_3(x-c)^2+4a_4(x-c)^3\tag{2}$$
$$f''(x)=1\cdot 2\cdot a_2+2\cdot3a_3(x-c)+3\cdot 4a_4(x-c)^2$$
$$f^{(3)}(x)=1\cdot 2\cdot3a_3+2\cdot 3\cdot 4a_4(x-c)$$
$$f^{(4)}(x)=2\cdot 3\cdot 4a_4$$
$$.etc$$

Let $x=c$, this will make $(x-c)$ part all vanish. we will evaluate the series centered at $c$, we will have

$$f(c)=a_0\tag{3}$$
$$f'(c)=1\cdot a_1$$
$$f''(c)=1\cdot 2\cdot a_2$$
$$f^{(3)}(c)=1\cdot 2\cdot 3\cdot a_3$$
$$f^{(4)}(c)=1\cdot 2\cdot 3\cdot 4\cdot a_4$$
$$.etc$$

The we can express this infinite series of equations in terms of $a_n$, we will have:

$$a_0=f(c)\tag{4}$$
$$a_1=\dfrac{f(c)}{1}=\dfrac{f(c)}{1!}$$
$$a_2=\dfrac{f''(c)}{1\cdot 2}=\dfrac{f''(c)}{2!}$$
$$a_3=\dfrac{f^{(3)}(c)}{1\cdot 2\cdot 3}=\dfrac{f^{(3)}(c)}{3!}$$
$$a_4=\dfrac{f^{(4)}(c)}{1\cdot 2\cdot 3\cdot 4}=\dfrac{f^{(4)}(c)}{4!}$$
$$.etc$$

Replacing these values of $a_n$ into the equation in $1$, we have:

$\boxed{f(c)+\dfrac{f'(c)}{1!}(x-c)+\dfrac{f''(c)}{2!}(x-c)^2+\dfrac{f'''(c)}{3!}(x-c)^3+\dfrac{f^{(4)}(c)}{4!}(x-c)^4...}$

$$\boxed{=\sum_{n=1}^{\infty} \dfrac{f^{(n)}(c)}{n!}(x-c)^n}$$

When the function's expansion is centered at $c=0$, the Taylor series is called the Maclaurin series.
$n$ cannot be a negative power or a fractional power. When $n$ is a negative power, the series is called Laurent series, and when $n$ is a fractional power, the series is known as Puiseux series.

$$\boxed{f(0)+\dfrac{f'(0)}{1!}x+\dfrac{f''(0)}{2!}x^2+\dfrac{f'''(0)}{3!}x^3+\dfrac{f^{(4)}(0)}{4!}x^4...=\sum_{n=1}^{\infty} \dfrac{f^{(n)}(0)}{n!}x^n}$$

Apply the formula to calculate the Taylor series for $e^{x}$, we have:

$f(x)=e^x \implies f(0)=e^0=1$

$f'(x)=e^x \implies f'(0)=e^0=1$

$f''(x)=e^x \implies f''(0)=e^0=1$

$f'''(x)=e^x \implies f'''(0)=e^0=1$

$e^x=1+1\cdot\dfrac{x}{1!}+1\cdot\dfrac{x^2}{2!}+1\cdot\dfrac{x^3}{3!}+1\cdot\dfrac{x^4}{4!}+1\cdot\dfrac{x^5}{5!}+O(x^5)$

$\implies e^x=1+\dfrac{x}{1!}+\dfrac{x^2}{2!}+\dfrac{x^3}{3!}+\dfrac{x^4}{4!}+\dfrac{x^5}{5!}+\dfrac{x^6}{6!}+O(x^7)$

$$\boxed{\Leftrightarrow\sum_{n=0}^{+\infty}\dfrac{x^n}{n!}}$$
We can also apply for this formula to find the series of $\sin(x)$. The function is odd so all of its even terms are $0$.

$f(x)=\sin(x) \implies f(0)=0$

$f'(x)=\cos(x) \implies f'(0)=1$

$f''(x)=-\sin(x) \implies f''(0)=0$

$f'''(x)=-\cos(x) \implies f'''(0)=-1$

$f^{(4)}(x)= \sin(x) \implies f^{(4)}(0)=0$

$f^{(5)}(x)= \cos(x) \implies f^{(5)}(0)=1$

$f^{(6)}(x)= -\sin(x) \implies f^{(6)}(0)=0$

$f^{(7)}(x)= -\cos(x) \implies f^{(7)}(0)=-1$

$\sin(x)=0-1\cdot\dfrac{x}{1!}+0\cdot\dfrac{x^2}{2!}-1\cdot\dfrac{x^3}{3!}+0\cdot\dfrac{x^4}{4!}+1\cdot\dfrac{x^5}{5!}+0\cdot\dfrac{x^6}{6!}(x^6)-1\cdot\dfrac{x^7}{7!}(x^7)+O(x^9)$

$\implies \sin(x)={x}-\dfrac{x^3}{3!}+\dfrac{x^5}{5!}-\dfrac{x^7}{7!}+\dfrac{x^9}{9!}-\dfrac{x^{11}}{11!}+O(x^{13})$ 

$$\boxed{ \Leftrightarrow  \sum_{k=0}^{\infty}\dfrac{(-1)x^{2n+1}}{(2n+1)!}}$$

We can do likewise for $\sinh(x)$

$f(x)=\sinh(x) \implies f(0)=0$

$f'(x)=\cosh(x) \implies f'(0)=1$

$f''(x)=-\sinh(x) \implies f''(0)=0$

$f'''(x)=\cosh(x) \implies f'''(0)=1$

$f^{(4)}(x)= \sinh(x) \implies f^{(4)}(0)=0$

$f^{(5)}(x)= \cosh(x) \implies f^{(5)}(0)=1$

$f^{(6)}(x)= -\sinh(x) \implies f^{(6)}(0)=0$

$f^{(7)}(x)= \sinh(x) \implies f^{(7)}(0)=1$

$\sinh(x)={x}+\dfrac{x^3}{3!}+\dfrac{x^5}{5!}+\dfrac{x^7}{7!}+\dfrac{x^9}{9!}+\dfrac{x^{11}}{11!}+O(x^{13})$

$$\boxed{\Leftrightarrow  \sum_{k=0}^{\infty}\dfrac{x^{2n+1}}{(2n+1)!}}$$

The series expansion for $\cos(x)$ 

$f(x)=\cos(x) \implies f(0)=1$

$f'(x)=-\sin(x) \implies f'(0)=0$

$f''(x)=-\cos(x) \implies f''(0)=-1$

$f'''(x)=-\sin(x) \implies f'''(0)=0$

$f^{(4)}(x)= \cos(x) \implies f^{(4)}(0)=1$

$f^{(5)}(x)= -\sin(x) \implies f^{(5)}(0)=0$

$f^{(6)}(x)= -\cos(x) \implies f^{(6)}(0)=-1$

$f^{(7)}(x)= \sin(x) \implies f^{(7)}(0)=0$

$\cos(x)={1}-\dfrac{x^2}{2!}+\dfrac{x^4}{4!}-\dfrac{x^6}{6!}+\dfrac{x^8}{8!}-\dfrac{x^{10}}{10!}+O(x^{12})$

$$\boxed{\Leftrightarrow  \sum_{k=0}^{\infty}\dfrac{(-1)x^{2n}}{(2n)!}}$$

The series expansion for $\cosh(x)$ 

$f(x)=\cosh(x) \implies f(0)=1$

$f'(x)=\sinh(x) \implies f'(0)=0$

$f''(x)=\cosh(x) \implies f''(0)=1$

$f'''(x)=\sinh(x) \implies f'''(0)=0$

$f^{(4)}(x)= \cosh(x) \implies f^{(4)}(0)=1$

$f^{(5)}(x)= \sinh(x) \implies f^{(5)}(0)=0$

$f^{(6)}(x)= \cosh(x) \implies f^{(6)}(0)=1$

$f^{(7)}(x)= \sinh(x) \implies f^{(7)}(0)=0$

$\cosh(x)={1}+\dfrac{x^2}{2!}+\dfrac{x^4}{4!}+\dfrac{x^6}{6!}+\dfrac{x^8}{8!}+\dfrac{x^{10}}{10!}+O(x^{12})$

$$\boxed{\Leftrightarrow  \sum_{k=0}^{\infty}\dfrac{x^{2n}}{(2n)!}}$$

Apart from these five functions, whose derivatives are rather simple like $e^x$ or cyclic like $\sin(x)$, $\cos(x)$, $\sinh(x)$, $\cosh(x)$, the Maclaurin formular do not bode well for other types of function. If you want, we can try the derivative of $\tan(x)$                                                                                       

$f(x)=\tan(x)$

$f'(x)=\sec^2(x)$

$f''(x)=2\tan(x)\sec^2(x)$

$f'''(x)=2\sec^2(x)[2\tan^2(x)+\sec^2(x)]$

$f^{(4)}=8\tan(x)\sec^2(x)[\tan^2(x)+2\sec^2(x)]$

The derivatives are not cyclic, which make computation of higher degrees more difficult.

We will explore different ways of expanding functions in Taylor series later. The basic formula for expanding functions centered at any point still remain important. But the Maclaurin counterpart can be replaced with easier techniques.

Ramanujan, the "Euler" of 20th century

      The first time I heard of the name Ramanujan was in 2017. At that time, I was wondering on the internet, searching information about i...