Maclaurin's series for $\log(1+ \tan x)$

13.7k Views Asked by At

I tried to find Maclaurin's expansion for $\log (1 + \tan x)$ by algebraic method as below but coefficients of $x^6$ and $x^7$ are not matching what is given in Mathematica.

What did I do wrong? I am not able to spot it.

\begin{equation*} \begin{split} \tan x &= x + \frac{x^3}{3} + \frac{2x^5}{15} + \frac{17}{315}x^7 + \ldots\\ \log (1+x) &= x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \frac{x^5}{5}- \ldots \\ \end{split} \end{equation*}

So,

\begin{equation*} \begin{split} \log (1+\tan x) &= \tan x - \frac{(\tan x)^2}{2} + \frac{(\tan x)^3}{3} - \frac{(\tan x)^4}{4} + \frac{(\tan x)^5}{5}- \ldots \\ \end{split} (\#eq:4ii) \end{equation*}

Lets find values of numerators in the fractions,

\begin{equation*} \begin{split} (\tan x)^2 &= \left(x + \frac{x^3}{3} + \frac{2x^5}{15} + \frac{17}{315}x^7 + \ldots\right)^2 \\ &= x^2 + 2x\left(\frac{x^3}{3} + \frac{2x^5}{15} + \frac{17}{315}x^7 + \ldots\right) + \left(\frac{x^3}{3} + \frac{2x^5}{15} + \frac{17}{315}x^7 + \ldots \right)^2 \\ &= x^2 + \frac{2x^4}{3} + \frac{4x^6}{15} + \ldots + \frac{x^6}{9} + \ldots\\ &= x^2 + \frac{2x^4}{3} + \frac{17x^6}{45} + \ldots\\ (\tan x)^3 &= \left(x + \frac{x^3}{3} + \frac{2x^5}{15} + \frac{17}{315}x^7 + \ldots \right)^3 \\ &= x^3 + 3x^2 \left(\frac{x^3}{3} + \frac{2x^5}{15} + \ldots\right) + 3x\left(\frac{x^3}{3} + \frac{2x^5}{15} + \ldots\right)^2 + \\ & \left(\frac{x^3}{3} + \frac{2x^5}{15} + \ldots\right)^3\\ &= x^3 + \frac{3x^5}{3} + \frac{6x^7}{15}+ \ldots + \frac{3x^7}{9} + \frac{12x^9}{45} + \ldots + \frac{x^9}{27} + \ldots \\ &= x^3 + \frac{3x^5}{3} + \frac{11x^7}{15}+ \ldots \\ (\tan x)^4 &= \left(x + \frac{x^3}{3} + \frac{2x^5}{15} + \frac{17}{315}x^7 + \ldots\right)^4 \\ &= x^4 + 4x^3\left(\frac{x^3}{3} + \frac{2x^5}{15} + \ldots\right) + \ldots\\ &= x^4 + \frac{4x^6}{3} + \ldots\\ (\tan x)^5 &= \left(x + \frac{x^3}{3} + \frac{2x^5}{15} + \frac{17}{315}x^7 + \ldots\right)^5 \\ &= x^5 + 5x^4\left(\frac{x^3}{3} + \frac{2x^5}{15} + \ldots\right) + \ldots\\ &= x^5 + \frac{5x^7}{3} + \ldots \end{split} \end{equation*}

Lets put these values in equation @ref(eq:4ii),

\begin{equation*} \begin{split} \log (1+\tan x) &= \tan x - \frac{(\tan x)^2}{2} + \frac{(\tan x)^3}{3} - \frac{(\tan x)^4}{4} + \frac{(\tan x)^5}{5}- \ldots \\ &= \left(x + \frac{x^3}{3} + \frac{2x^5}{15} + \frac{17}{315}x^7 + \ldots\right) - \frac{1}{2}\left(x^2 + \frac{2x^4}{3} + \frac{17x^6}{45} + \ldots\right) + \\ & \frac{1}{3}\left(x^3 + \frac{3x^5}{3} + \frac{11x^7}{15}+ \ldots\right) - \frac{1}{4}\left(x^4 + \frac{4x^6}{3} + \ldots\right) + \\ & \frac{1}{5}\left(x^5+ \frac{5x^7}{3} + \ldots\right) \end{split} \end{equation*}

Now collecting coefficients of $x, x^2, x^3, x^4, x^5, x^6, x^7$,

enter image description here

Expansion is then,

\begin{equation*} \begin{split} \log (1+\tan x) &= x -\frac{1}{2}x^2 + \frac{2}{3}x^3 - \frac{7}{12}x^4 + \frac{2}{3}x^5 -\frac{47}{90}x^6 + \frac{199}{315}x^7 - \ldots \end{split} \end{equation*}

1

There are 1 best solutions below

2
On BEST ANSWER

As mentioned in the comments, you did not account for $\tan^6(x)$ and $\tan^7(x)$, which both contribute to the terms you are looking at.

For a much easier approach, observe that the derivative is given by

\begin{align}\frac{\mathrm d}{\mathrm dx}\ln(1+\tan(x))&=\frac{\sec^2(x)}{1+\tan(x)}\\&=\frac{1+\tan^2(x)}{1+\tan(x)}\\&=\frac{1+\left(x+\frac13x^3+\frac2{15}x^5\right)^2}{1+x+\frac13x^3+\frac2{15}x^5}+\mathcal O(x^7)\\&=\frac{1+x^2+\frac23x^4+\frac{17}{45}x^6}{1+x+\frac13x^3+\frac2{15}x^5}+\mathcal O(x^7)\\&=1-x+2x^2-\frac73x^3+\frac{10}3x^4-\frac{62}{15}x^5+\frac{244}{45}x^6+\mathcal O(x^7)\end{align}

which can easily be integrated to give the desired result.