Home Up Back Forward Leave Message

Taylor Series of $sin(x)$ and $cos(x)$

We already know the derivatives of $sin(x)$ and $cos(x)$ and thus we can deduce the following:
$$ \begin{aligned} {d \over dx}\left( sin(x) \right) & = sin^{(1)}(x) = cos(x)\\ {d \over dx}\left( cos(x) \right) & = cos^{(1)}(x) = sin^{(2)}(x) = -sin(x)\\ {d \over dx}\left( -sin(x) \right) & = cos^{(2)}(x) = sin^{(3)}(x) = -cos(x)\\ {d \over dx}\left( -cos(x) \right) & = cos^{(3)}(x) = sin^{(4)}(x) = sin(x)\\ sin(0) & = 0\\ cos^{(0)}(0) & = sin^{(1)}(0) = cos(0) = 1\\ cos^{(1)}(0) & = sin^{(2)}(0) = -sin(0) = 0\\ cos^{(2)}(0) & = sin^{(3)}(0) = -cos(0) = -1\\ cos^{(3)}(0) & = sin^{(4)}(0) = sin(0) = 0\\ \end{aligned} $$
We can use these values now to determine the Taylor Series for $cos(x)$ and $sin(x)$:
$$ \begin{aligned} cos(x) & = \sum_{j=0}^\infty cos^{(j)}(0) \cdot {{x^j} \over j!}\\ & = cos^{(0)}(0) \cdot {{x^0} \over 0!} + cos^{(1)}(0) \cdot {{x^1} \over 1!} + cos^{(2)}(0) \cdot {{x^2} \over 2!} + cos^{(3)}(0) \cdot {{x^3} \over 3!} + ...\\ & = 1 + 0 \cdot x - 1 \cdot {{x^2} \over 2!} - 0 \cdot {{x^3} \over 3!} + 1 \cdot {{x^4} \over 4!} + .....\\ & = 1 - {{x^2} \over 2!} + {{x^4} \over 4!} - ......\\ cos(x) & = \sum_{j=0}^\infty (-1)^j \cdot {{x^{2j}} \over {(2j)!}}\\ sin(x) & = \sum_{j=0}^\infty sin^{(j)}(0) \cdot {{x^j} \over j!}\\ & = sin^{(0)}(0) \cdot {{x^0} \over 0!} + sin^{(1)}(0) \cdot {{x^1} \over 1!} + sin^{(2)}(0) \cdot {{x^2} \over 2!} + sin^{(3)}(0) \cdot {{x^3} \over 3!} + ...\\ & = 0 + 1 \cdot x + 0\cdot {{x^2} \over 2!} - 1 \cdot {{x^3} \over 3!} - 0 \cdot {{x^4} \over 4!} + 1 \cdot {{x^5} \over 5!} + .....\\ & = x - {{x^3} \over 3!} + {{x^5} \over 5!} - ......\\ sin(x) & = \sum_{j=0}^\infty (-1)^j \cdot {{x^{2j+1}} \over {(2j+1)!}} \end{aligned} $$

Taylor Series of $tan(x)$

Let's look at determining the Taylor Series for $tan(x)$. Let's start of with determining the derivatives of $tan(x)$ and then the values at $x=0$:
$$ \begin{aligned} tan^{(1)}(x) & = {d \over dx} \left( tan(x) \right)\\ & = {d \over dx} \left( {{sin(x)} \over {cos(x)}} \right)\\ & = {{cos(x)^2 + sin(x)^2} \over {cos(x)^2}}\\ & = 1 + tan(x)^2\\ tan^{(2)}(x) & = {d \over dx} \left( 1+tan(x)^2 \right) \\ & = 2 \cdot tan(x) \cdot (1 + tan(x)^2)\\ & = 2 \cdot tan(x) + 2 \cdot tan(x)^3\\ tan^{(3)}(x) & = {d \over dx} \left( 2 \cdot tan(x)+ 2 \cdot tan(x)^3 \right)\\ & = 2 \cdot \left(1 + tan(x)^2\right) + 6 \cdot tan(x)^2 \cdot \left( 1 + tan(x)^2 \right)\\ & = 2 + 8 \cdot tan(x)^2 + 6 \cdot tan(x)^4 \\ tan^{(4)}(x) & = {d \over dx} \left( 2 + 8 \cdot tan(x)^2 + 6 \cdot tan(x)^4 \right)\\ & = 16 \cdot tan(x) \cdot \left(1 + tan(x)^2 \right) + 24 \cdot tan(x)^3 \cdot \left( 1 + tan(x)^2 \right)\\ & = 16 \cdot tan(x) + 40 \cdot tan(x)^3 + 24 \cdot tan(x)^5\\ tan^{(5)}(x) & = {d \over dx} \left( 16 \cdot tan(x) + 40 \cdot tan(x)^3 + 24 \cdot tan(x)^5 \right)\\ & = 16 \cdot \left( 1 + tan(x)^2 \right) + 120 \cdot tan(x)^2 \left( 1+tan(x)^2\right) + 120 \cdot tan(x)^4 \left( 1 + tan(x)^2 \right)\\ & = 16 + 136 \cdot tan(x)^2 + 240 \cdot tan(x)^4 + 120 \cdot tan(x)^6\\ \end{aligned} $$
Now we can determine the values as zero:
$$ \begin{aligned} tan^{(0)}(0) & = 0\\ tan^{(1)}(0) & = 1 + tan(0)^2 = 1\\ tan^{(2)}(0) & = 2 \cdot tan(0) + 2 \cdot tan(0)^3 = 0\\ tan^{(3)}(0) & = 2 + 8 \cdot tan(0)^2 + 6 \cdot tan(0)^4 = 2\\ tan^{(4)}(0) & = 16 \cdot tan(0) + 40 \cdot tan(0)^3 + 24 \cdot tan(0)^5 = 0\\ tan^{(5)}(0) & = 16 + 136 \cdot tan(0)^2 + 240 \cdot tan(0)^4 + 120 \cdot tan(0)^6 = 16\\ tan^{(6)}(0) & = 0\\ tan^{(7)}(0) & = 272\\ tan^{(8)}(0) & = 0\\ tan^{(9)}(0) & = 7936\\ tan^{(10)}(0) & = 0\\ tan^{(11)}(0) & = 353792\\ tan(x) & = 0 + x + 0 + 2 \cdot {{x^3} \over 6} + 0 + 16 \cdot {{x^5} \over 120} + 0 + 272 \cdot {{x^7} \over 5040} + 0 + 7936 \cdot {{x^9} \over 362880} + 0 + 353792 \cdot {{x^9} \over 39916800} + 0 + .....\\ & = x + {1 \over 3}{x^3} + {2 \over 15}x^5 + {17 \over 315}x^7 + {62 \over 2835}x^9 + {1382 \over 155925}x^{11}+ ... \end{aligned} $$