[Math] Taylor series $\ln(\tan(x))-\ln(x)$ for point $0$

sequences-and-seriestaylor expansion

Well.

I want to find the Taylor series for the function:

$$f(x) = \ln(\tan(x))-\ln(x),$$

order $5$ for point $c=0$.
Maple's result is:
$$\ln(\tan(x))-\ln(x) = \frac 13x^2+\frac 7{90}x^4+O(x^6).$$

And my simple question is: How?

I really don't see how I can find the Taylor series when $\ln(\tan(0))-\ln(0)$ (which is the first term in the Taylor series) is undefined?

Best Answer

First, as already noted by many, we have

$$\ln(\tan x)-\ln x=\ln\left(\frac{\tan x}x\right) = \ln\left(\frac{\sin x}x \frac{1}{\cos x}\right)$$

So when $x \to 0$, the term inside the logarithm will go to $1$, so no problems there. From this we can also already conclude that there will be no constant term in the Taylor series, as $\ln(1 \pm \epsilon) \to 0$ as $\epsilon \to 0$.

Next, we can use the Taylor series for $\tan(x)$ to get

$$\frac{\tan x}{x}=1+\frac{1}{3}x^2+\frac{2}{15}x^4+\frac{17}{315}x^6+\frac{62}{2835}x^8+\ldots$$

Using the Taylor series for $\ln(1+x)$ then gives us

$$\ln\left(\frac{\tan x}x\right) = \ln\left(1+\left(\frac{1}{3}x^2+\frac{2}{15}x^4+\frac{17}{315}x^6+\frac{62}{2835}x^8+\ldots\right)\right)$$ $$ = y - \frac{1}{2} y^2 + \frac{1}{3} y^3 - \frac{1}{4}y^4 + \ldots$$

where

$$y = \frac{1}{3}x^2+\frac{2}{15}x^4+\frac{17}{315}x^6+\frac{62}{2835}x^8+\ldots$$

The rest is just hard work. You could calculate the lower order terms for each of the powers of $y$ first.

$$\begin{array}{rcl} y &=& \frac{1}{3}x^2+\frac{2}{15}x^4+\frac{17}{315}x^6+\frac{62}{2835}x^8+\ldots \\ \frac{1}{2}y^2 &=& \frac{1}{18}x^4+\frac{2}{45}x^6+\left(\frac{17}{945}+\frac{2}{225}\right)x^8+\ldots \\ \frac{1}{3}y^3 &=& \frac{1}{81}x^6+\frac{2}{135}x^8+\ldots \\ \frac{1}{4}y^4 &=& \frac{1}{324}x^8+\ldots \end{array}$$

Adding it all up, we get

$$\ln(\tan x)-\ln x = y - \frac{1}{2} y^2 + \frac{1}{3} y^3 - \frac{1}{4}y^4 + \ldots$$ $$= \frac{1}{3}x^2 + \left(\frac{2}{15} - \frac{1}{18}\right)x^4 + \left(\frac{17}{315}-\frac{2}{45}+\frac{1}{81}\right)x^6 + \left(\frac{62}{2835} - \frac{17}{945} - \frac{2}{225} + \frac{2}{135} - \frac{1}{324}\right)x^8 + \ldots$$ $$= \frac{1}{3}x^2 + \frac{7}{90}x^4 + \frac{62}{2835}x^6 + \frac{127}{18900}x^8 + \ldots$$