# How to expand $\tan x$ in Taylor order to $o(x^6)$

I try to expand $\tan x$ in Taylor order to $o(x^6)$, but searching of all 6 derivative in zero (ex. $\tan'(0), \tan''(0)$ and e.t.c.) is very difficult and slow method.

Is there another way to solve the problem?

Any help would be greatly appreciated :)

-

If you can use known series for $\sin(x)$ and $\cos(x)$, set up the equation $(\cos x)*(\tan x) = \sin x$, where you put unknown constants as coefficients of the $\tan x$ series. Multiply things out and compare coefficients, giving equations on the letters you used for the $\tan x$ series coefficients. Then solve those equations (they should end up linear equations). This won't be too bad as you only need the first six terms.

ADDED: If you are "not allowed to use" sine and cosine series as already given, it would be easy to derive the first six terms of each, since derivatives of sine and cos have a simple pattern. Also, instead of multiplying out, you could use long division and just divide the first six terms of cosine into the first six of sine, only going until you reach the power $x^6$.

EDIT: Here's the basics for the long division. One is dividing $$1-(1/2)x^3+(1/24)x^4-(1/720)x^6$$ into $$x -(1/3)x^3+(2/15)x^5.$$ The first term in the quotient is $x$, and after multiplying through the divisor by this and subtracting (bringing down only up to before $x^7$) the next line is $$(1/3)x^3-(1/30)x^5 +...$$ (don't need the next $x^7$ term) so the next term of the quotient is $(1/3)x^3$, and again multiply through the divisor by this and subtract, giving the next line which starts out $(2/15)x^5$, and nothing needed beyond that power, giving the desired coefficient of $(2/15)x^5$ as the next term of the qoitient. Stringing the quotient terms together we have the first few terms for tangent as $x+(1/3)x^3+(2/15)x^5.$

-
+1: But actually you only need to solve for three unknowns, as $\tan x$ is an odd function :-) – Jyrki Lahtonen Jan 25 '13 at 9:51
Thanks cofeemath :) – Nicole Grefder Jan 25 '13 at 9:54

Let's integrate repetitively $\ \tan'(x)=1+\tan(x)^2\$ starting with $\,\tan(x)\approx x$ :

\begin{align} \tan(x)&\small{=}\ x+O\bigl(x^2\bigr)\\ &\small{=\int 1+\left(x+O\bigl(x^2\bigr)\right)^2\,dx}=x+\frac {x^3}3+O\bigl(x^4\bigr)\\ &\small{=\int 1+\left(x+\frac {x^3}3+O\bigl(x^4\bigr)\right)^2dx=\int 1+x^2+\frac {2x^4}3\,dx+O\bigl(x^6\bigr)}=x+\frac {x^3}3+\frac {2x^5}{15}+O\bigl(x^6\bigr)\\ &= \cdots\\ \end{align}

Every integration gives another coefficient of $\ \displaystyle\tan(x)=\sum_{n\ge 0} a_n\ x^{2n+1}\$ and we get simply : $$a_n=\begin{cases} &\quad\ 1&n=0\\[6pt] &\frac 1{2n+1} \sum_{k=0}^{n-1} a_k\ a_{n-1-k}&n>0\\ \end{cases}$$ i.e. the sequence $$(a_n)_{n\in\mathbb{N}}=\left(\frac 11,\frac 13, \frac 2{15}, \frac {17}{315}, \frac {62}{2835}, \frac{1382}{155925},\cdots\right)$$

-
interesting approach. +1 – coffeemath Jan 25 '13 at 18:30
Thanks @coffeemath ! – Raymond Manzoni Jan 25 '13 at 22:27

We know the following (from e.g. Wikipedia): \begin{align} &\sin(x) = x -\frac{x^3}{6} +\frac{x^5}{120}+ O(x^7) \\ &\cos(x) = 1 -\frac{x^2}{2} +\frac{x^4}{24} +\frac{x^6}{720} +O(x^8) \\ &\tan(x) = a +bx+ cx^2+dx^3+ex^4+fx^5+gx^6+ O(x^7) \end{align} Furthermore it holds $\tan(x) = \frac{\sin(x)}{\cos(x)} \Rightarrow \sin(x) =\tan(x)\cos(x)$. So we get \begin{align} x -\frac{x^3}{6} +\frac{x^5}{120}+ O(x^7) =& \bigl(1 -\frac{x^2}{2} +\frac{x^4}{24} +\frac{x^6}{720} +O(x^8) \bigr) \\ &\cdot\bigl(a +bx+ cx^2+dx^3+ex^4+fx^5+gx^6+ O(x^7)\bigr) \end{align} If we expand the term on the right hand side we obtain \begin{align} x -\frac{x^3}{6} +\frac{x^5}{120}+ O(x^7) &=a+bx+(-\frac{a}{2}+c)x^2+(-\frac{b}{2}+d)x^3 \\&+(\frac{a}{24}-\frac{c}{2}+e)x^4+(\frac{b}{24}-\frac{d}{2}+f)x^5 \\&+(\frac{a}{720}+\frac{c}{24}-\frac{e}{2}+g)x^6+ O(x^7) \end{align} From this we can deduct the linear system \begin{align} \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0&0\\ 0 & 1 & 0 & 0 & 0 & 0 &0\\ -1/2 &0 &1 & 0& 0& 0&0\\ 0 & -1/2 & 0 & 1 & 0 & 0&0 \\ 1/24 & 0 & -1/2 & 0 & 1 & 0&0\\ 0 &1/24 & 0 & -1/2 & 0 & 1&0\\ 1/720 & 0 & 1/24 & 0 & -1/2 & 0 &1 \end{pmatrix} \begin{pmatrix} a\\b\\c\\d\\e\\f\\g \end{pmatrix} = \begin{pmatrix} 0\\1 \\ 0 \\ -1/6 \\ 0 \\1/120 \\ 0 \end{pmatrix} \end{align} Which has the solution \begin{align} \begin{pmatrix} a\\b\\c\\d\\e\\f\\g \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \\ 0 \\ 1/3 \\ 0 \\2/15 \end{pmatrix} \end{align} [Note that you can actually extract two linear systems of the one given above. You then only have to solve for the odd powers of $x$ as $\tan(x)$ is odd.]