[Math] Maclaurin series for $f(x)=\ln(1+\tan{x})$

calculuspower seriestaylor expansion

How to find the Maclaurin series for $f(x)=\ln(1+\tan {x})$. I tried it by successively differentiating it up to four times but it is very time consuming.

Best Answer

According to OEIS, the series can be written as $$\log (1+\tan x) = \sum_{n=0}^\infty \frac{a_n}{n!} x^n,$$ where $$a_n = \sum_{m=0}^{(n-1)/2} \sum_{j=0}^{2m} \binom{j+n-2m-1}{n-2m-1} \frac{(j+n-2m)!}{n-2m} \, 2^{2m-j} (-1)^{n-m+j-1} \left\{{n} \atop {j+n-2m}\right\}$$ where $\{{a \atop b}\}$ is a Stirling number of the second kind. Numeric calculation with Mathematica supports this; e.g.,

S[u_] := (Range[u + 1] - 1)! CoefficientList[Normal[Series[Log[1 + Tan[x]],
         {x, 0, u}]], x] - Table[Sum[Binomial[j + n - 2 m - 1, n - 2 m - 1]
         (j + n - 2 m)! 2^(2 m - j) (-1)^(n - m + j - 1) StirlingS2[n,
         j + n - 2 m]/(n - 2 m), {m, 0, (n - 1)/2}, {j, 0, 2 m}], {n, 0, u}]

Then S[50] for example gives a list of zeros, indicating equality.

Related Question