# What or where is the series expansion of the function $\ln\bigl(\frac{\tan x}{x}-1\bigr)$ or $\ln(\tan x-x)$ around $x=0$?

It is known that $$\begin{equation*} \tan x=\sum_{k=1}^{\infty}\frac{2^{2k}\bigl(2^{2k}-1\bigr)}{(2k)!}|B_{2k}|x^{2k-1}, \quad |x|<\frac{\pi}{2} \end{equation*}$$ and $$\begin{equation*} \ln\tan x=\ln x+\sum_{k=1}^{\infty}\frac{2^{2k}\bigl(2^{2k-1}-1\bigr)}{k(2k)!}|B_{2k}|x^{2k}, \quad 0 where $$B_{2k}$$ denotes the classical Bernoulli numbers. From the second series expansion, we acquire $$\begin{equation*} \ln\frac{\tan x}{x}=\sum_{k=1}^{\infty}\frac{2^{2k}\bigl(2^{2k-1}-1\bigr)}{k(2k)!}|B_{2k}|x^{2k}, \quad |x|<\frac{\pi}{2}. \end{equation*}$$ My question is:

What and where is the series expansion of the function $$\ln\bigl(\frac{\tan x}{x}-1\bigr)$$ or $$\ln(\tan x-x)$$ around $$x=0$$?

References

1. I. S. Gradshteyn and I. M. Ryzhik, Table of Integrals, Series, and Products, Translated from the Russian, Translation edited and with a preface by Daniel Zwillinger and Victor Moll, Eighth edition, Revised from the seventh edition, Elsevier/Academic Press, Amsterdam, 2015; available online at https://doi.org/10.1016/B978-0-12-384933-5.00013-8.
• Equivalently, what is the series expansion of the function $$\ln\frac{3(\tan x-x)}{x^3}=\ln\biggl[\frac{3}{x^2}\biggl(\frac{\tan x}{x}-1\biggr)\biggr]$$ around $x=0$ for $|x|<\frac{\pi}{2}$? Commented Apr 7, 2023 at 1:31
• The first several terms are $3 \log(x) - \log(3) + \frac{2 x^2}{5}+\frac{43 x^4}{525}+\frac{524 x^6}{23625}+\frac{40897 x^8}{6063750}+\frac{19393844 x^{10}}{8868234375}+\cdots$. Any computer algebra system can compute lots more terms. (I typed Series[Log[Tan[x] - x], {x, 0, 10}] in Mathematica.) Do you have any reason to believe that there is a better answer than this? Commented Apr 7, 2023 at 2:31
• @DavidESpeyer Yes, you are right: any computer algebra system can compute lots more terms. I can do that by Wolfram Mathematica too. I did that already. But I cannot write out the expression (formula) of the general term for the coefficients of the series expansion of the function $\ln(\tan x-x)$, or $\ln\bigl(\frac{\tan x}{x}-1\bigr)$, or $\ln\frac{3(\tan x-x)}{x^3}=\ln\bigl[\frac{3}{x^2}\bigl(\frac{\tan x}{x}-1\bigr)\bigr]$ around $x=0$. Can you please? Commented Apr 7, 2023 at 2:47
• I can't, but I have no reason to expect that there is a closed formula. The Taylor series of a randomly chosen function usually doesn't have one. Commented Apr 7, 2023 at 2:49
• @DavidESpeyer I think that the general term of the coefficients in the Maclaurin series expansion of any one of the functions mentioned here has a closed-form formula (expression) , because all the derivatives of the function $\ln\frac{3(\tan x-x)}{x^3}$, for example, $$\biggl[\ln\frac{3(\tan x-x)}{x^3}\biggr]'=\frac{3 \tan x-x \sec ^2x-2 x}{x (x-\tan x)},$$ are all elementary functions and are analytic at $x=0$. Commented Apr 7, 2023 at 3:08

Another approach is obtained by introducing the Bessel functions to express \begin{align} f(x)&=\ln\left(\frac{\tan x-x}{x^3}\right)\\ &=\ln\left( \frac{\sin x-x\cos x}{x^3\cos x} \right)\\ &=\ln\left( \frac{J_{3/2}(x)}{x^2J_{-1/2}(x)} \right) \end{align} In a paper by Dickinson a uniformly convergent series expansion is given for the logarithm of a Bessel function: $$$$\ln J_{\nu}(x)=\ln \left(\frac{(x / 2)^{\nu}}{\Gamma(\nu+1)}\right)+\sum_{n=1}^{\infty} \ln \left(1-\frac{x^2}{j_{\nu, n}}\right)$$$$ when $$\nu>-1$$ and $$0 ($$j_{\nu,n}$$ is the $$n$$-th zero of the Bessel function of order $$\nu$$). Then, \begin{align} \ln J_{\nu}(x)&=\ln \left(\frac{(x / 2)^{\nu}}{\Gamma(\nu+1)}\right)-\sum_{n=1}^{\infty}\sum_{k=0}^{\infty} \frac{1}{k+1}\frac{x^{2k+2}}{j_{\nu,n}^{2k+2}}\\ &=\ln \left(\frac{(x / 2)^{\nu}}{\Gamma(\nu+1)}\right)-\sum_{k=0}^{\infty} \frac{x^{2k+2}}{k+1}\sum_{n=1}^{\infty}\frac{1}{j_{\nu,n}^{2k+2}} \end{align} (all the summands in the convergent double series are positive and we may interchange the order of summation). Thus \begin{align} f(x)&=-2\ln x+\ln J_{3/2}(x)-\ln J_{-1/2}(x)\\ &=-\ln3 +\sum_{k=0}^{\infty} \frac{x^{2k+2}}{k+1}\left(\sum_{n=1}^{\infty} \frac{1}{j_{-1/2,n}^{2k+2}}-\sum_{n=1}^{\infty}\frac{1}{j_{3/2,n}^{2k+2}} \right) \end{align}

The sum of inverse even powers of zeros of Bessel functions appears in problems involving the diffusion equation and a broad literature exists on the topic. The quantity $$$$\sigma(p,\nu)=\sum_{n=1}^\infty\frac{1}{j_{\nu,n}^{2p}}$$$$ is discussed here. A recent analysis can be found in a paper by Jorge L. deLyra where a general formula for certain linear combinations of these sums is given ; it can be used to derive the formulas for $$\sigma(p, \nu)$$ by purely linear-algebraic means. The first values for $$\nu=3/2$$ are \begin{align} &\sigma(1,3/2)=\frac{1}{10}\;;\;\sigma(2,3/2)=\frac{1}{350}\;;\;\sigma(3,3/2)=\frac{1}{7875}\\ &\sigma(4,3/2)=\frac{37}{6063750}\;;\;\sigma(5,3/2)=\frac{59}{197071875} \end{align} while $$j_{-1/2,n}=(2n-1)\pi/2$$. Then \begin{align} \sigma(k+1,-1/2)&=\sum_{n=1}^\infty\frac{1}{j_{-1/2,n}^{2k+2}}\\ &=\sum_{n=1}^\infty\left(\frac{2}{(2n-1)\pi} \right)^{2k+2}\\ &=\left( \frac{2}{\pi} \right)^{2k+2}(2^{2k+2}-1)\zeta(2k+2)\\ &=(2^{2k+2}-1)\frac{2^{2k+1}}{(2k+2)!}|B_{2k+2}| \end{align} Latter identity is obtained expressing the Zeta function at even values in terms of the Bernoulli numbers. Finally, \begin{align} f(x)&=-\ln3 +\sum_{k=0}^{\infty} \frac{x^{2k+2}}{k+1}\left(\sigma(k+1,-1/2)-\sigma(k+1,3/2)\right)\\ &=-\ln3 +\sum_{k=0}^{\infty} \frac{x^{2k+2}}{k+1}\left((2^{2k+2}-1)\frac{2^{2k+1}}{(2k+2)!}|B_{2k+2}|-\sigma(k+1,3/2)\right) \end{align} which leads to the same first terms as in the expansion given by other users.

• This answer surely gives a Maclaurin power series expansion of the function $f(x)$. Regrettably, its coefficients aren't of closed-form, since $\sigma\bigl(k+1,\frac32\bigr)$ isn't of closed-form. What I emphasized is that the coefficients are of closed-form. The answer at mathoverflow.net/a/444485 is still the best one, although it was voted down by somebodies. Commented Apr 12, 2023 at 16:51
• Comparing this answer with the one at mathoverflow.net/a/444485 results in $$\sigma\biggl(k,\frac32\biggr)=\frac{(2^{2k}-1)2^{2k-1}|B_{2k}|+3^{2k}k D_{2k}}{(2k)!}$$ for $k\ge1$. This means that the sequence $\sigma\bigl(k,\frac32\bigr)$ for $k\ge1$ can be expressed by a closed-form formula, not an infinite series. Therefore, if one can directly find a closed-form expression for $\sigma\bigl(k,\frac32\bigr)$, this answer will be perfect. Commented Apr 12, 2023 at 18:42
• Let $j_{\nu,n}$ for $n\in\mathbb{N}$ denote the zeros of $\frac{J_\nu(z)}{z^{v}}$, where \begin{equation*} J_\nu(z)=\biggl(\frac{z}2\biggr)^\nu\sum_{n=0}^\infty\frac{(-1)^n(z/2)^{2n}}{n!\Gamma(\nu+n+1)}, \quad z\in\mathbb{C} \end{equation*} is the Bessel function of the first kind and $\nu\in\mathbb{C}\setminus\{-1,-2,\dotsc\}$ is called the order of $J_\nu(z)$. The Bessel zeta function is defined by \begin{equation*} \zeta_\nu(q)=\sum_{n=1}^{\infty}\frac{1}{j_{\nu,n}^q}, \quad q>1. \end{equation*} I think that the quantity $\sigma(p,\nu)=\zeta_\nu(2p)$. Commented Apr 16, 2023 at 3:20
• If $\sigma(p,\nu)=\zeta_\nu(2p)$ is true, then the quantity $\sigma(p,\nu)$ has a closed-form expression $$\sigma(k,\nu+1)=\zeta_{\nu+1}(2k) =(-1)^{k+1}\frac{[\Gamma(\nu+2)]^{2k+1}}{(2k)!} \begin{vmatrix} P_{2k+1,1}(\nu) & Q_{2k+1,2k}(\nu) \end{vmatrix}_{(2k+1)\times(2k+1)}$$ for $k\in\mathbb{N}$ and $\nu\in\mathbb{C}\setminus\{-1,-2,\dotsc\}$. For more details, please refer to my paper at doi.org/10.32604/cmes.2021.016431. Then this answer is perfect: the coefficients in the series expansion are closed-form expressions. Commented Apr 16, 2023 at 3:34
• In the above paper, we also have $$\sigma(k,\nu)=\zeta_{\nu}(2k) =\frac{(-1)^{k+1}\nu}{(2k)!} \begin{vmatrix} \frac{1}{(\nu)_0} & \frac{1}{(\nu+1)_0} & \dotsm & 0 & 0\\ 0 & 0 & \dotsm& 0 & 0\\ \frac{1}{2(\nu)_1} & \frac{1}{2(\nu+1)_1} & \dotsm & 0 &0\\ \vdots & \vdots & \ddots & \vdots & \vdots\\ \frac{(2k-3)!!}{2^{k-1}(\nu)_{k-1}} & \frac{(2k-3)!!}{2^{k-1}(\nu+1)_{k-1}} &\dotsm & \frac{1}{(\nu+1)_0} & 0\\ 0 & 0 & \dotsm & 0 & \frac{1}{(\nu+1)_0}\\ \frac{(2k-1)!!}{2^{k}(\nu)_k} & \frac{(2k-1)!!}{2^{k}(\nu+1)_k} & \dotsm & \binom{2k}{2k-2}\frac{1}{2(\nu+1)_1} & 0 \end{vmatrix}.$$ Commented Apr 16, 2023 at 3:48

You can write the series coefficients of \begin{align} f(x)&=\log[3x^{-3}(\tan x-x)] \tag{1a}\\ &=\sum_{n=1}^{\infty} f^{(n)}(0) \frac{x^n}{n!} \tag{1b}\\ &=\frac{2 x^2}{5}+\frac{43 x^4}{525} +\frac{524 x^6}{23625}+\frac{40897 x^8}{6063750} +\frac{19393844 x^{10}}{8868234375} +O(x^{12}) \tag{1c} \end{align} according to \begin{align} f^{(n)}(0) = Y\left(\left[-(k-1)!,\quad-2^{k+2}\textstyle\binom{k+3}{k}^{-1}\cos(\pi k/2)E_{k+3}(0)\right]_{k=1}^n\right). \tag{2}\label{2} \end{align} Here, $$Y()$$ is the generalized Bell polynomial of the given $$n\times2$$ matrix, with Euler polynomials $$E_k(x)$$. The corresponding Mathematica code reads:

Series[Log[3/x^3 (Tan[x] - x)], {x,0,10}]
Sum[BellY[Table[{-(k-1)!,-2^(k+2) Cos[Pi k/2] EulerE[k+3,0]/
Binomial[k+3,k]},{k,n}]] x^n/n!, {n,1,10}]


Eq. \eqref{2} was obtained by writing $$f(x)=g(h(x))$$, with \begin{align} g(x) &= \log(1-x) = -\sum_{k=0}^\infty \frac{x^k}{k}, \tag{3a}\\ h(x) &= 1-\frac{3}{x^{3}}(\tan x-x) = -\sum_{k=1}^\infty 3 \cos(\pi k/2) \frac{2^{k+3} E_{k+3}(0)}{(k+3)!} x^k, \tag{3b} \end{align} and using the Arbogast–Faà di Bruno formula (https://en.wikipedia.org/wiki/Faà_di_Bruno's_formula, http://reference.wolfram.com/language/ref/BellY.html).

I guess there is no "closed-form" solution, as the involved polynomials become more and more complicated.

• I am sure that there is a closed-form expression for the general term of the coefficients in the Mackaurin power series expansion of the functions mentioned in the question and its first comment by me. I am sure! I am working on it now. Commented Apr 7, 2023 at 13:37
• How did you get the relation $f^{(n)}(0)=Y(…)$? Can you give a reference to it? I repeat again that I have found a closed-form expression. @FredHucht Commented Apr 7, 2023 at 14:31
• I have added a short explanation to my answer. I am looking forward to your closed-form expression. Commented Apr 7, 2023 at 16:20
• @FredHucht The function $h(x)$ can be expanded into $$h(x)=1-3\sum_{k=0}^{\infty}\frac{2^{2k+4}\bigl(2^{2k+4}-1\bigr)} {(2k+4)!}|B_{2k+4}| x^{2k}$$ for $|x|<\frac{\pi}{2}$. By the Faa di Bruno formula, we have $$f^{(n)}(0)=-\sum_{k=0}^n\frac{(k-1)!}{[1-h(0)]^{k}} B_{n,k}\bigl(h'(0),h''(0),\dotsc,h^{(n-k+1)}(0)\bigr)$$ with $$h^{(2k+1)}(0)=0$$ and $$h^{(2k)}(0)=3\bigl(2^{2k+4}-1\bigr)2^{2k+4}\frac{(2k)!}{(2k+4)!}|B_{2k+4}|$$ for $k\ge0$, where $B_{n,k}=Y_{n,k}$ is the partial Bell polynomials. Is it easy to compute $$B_{n,k}\bigl(h'(0),h''(0),\dotsc,h^{(n-k+1)}(0)\bigr)$$ for all $n\ge k\ge0$? Commented Apr 7, 2023 at 18:47
• @qifeng618 I don't think your determinant answer is more "closed-form" than my BellY answer, both are recursion relations. Btw, you can reduce the matrix size from $2k \times 2k$ to $k \times k$ by rearranging the rows and columns, first the odd and then the even rows/cols. The resulting $2\times 2$ block diagonal matrix has one trivial and one non-trivial determinant. Further, you should consider to vote up useful answers. Commented Apr 11, 2023 at 17:30

Let $$\begin{equation*} f(x)=\begin{cases} \ln\dfrac{\tan x-x}{x^3}, & 0<|x|<\dfrac{\pi}{2};\\ -\ln3, & x=0. \end{cases} \end{equation*}$$ Then the even function $$f(x)$$ has the Maclaurin power series expansion \label{ln-tan-x-cubic-ser-expans} \begin{aligned} f(x)&=-\ln3-\sum_{k=1}^{\infty}\frac{3^{2k}D_{2k}}{(2k)!}x^{2k}\\ &=-\ln3+\frac{2 x^2}{5}+\frac{43 x^4}{525}+\frac{524 x^6}{23625}+\frac{40897 x^8}{6063750} +\frac{19393844 x^{10}}{8868234375}+\dotsm \end{aligned} for $$|x|<\frac{\pi}{2}$$, where \begin{align*} D_{2k}&=\begin{vmatrix} 0 & Q_0 & 0 & \dotsm&0& 0& 0\\ Q_1 & 0 & Q_0 & \dotsm& 0&0& 0\\ 0 & Q_1 & 0 & \dotsm& 0& 0&0\\ \dotsm & \dotsm & \dotsm & \ddots&\dotsm& \dotsm& \dotsm\\ Q_{k-1} & 0 & \binom{2k-3}{1}Q_{k-2} & \dotsm& 0 & Q_0 & 0\\ 0 & Q_{k-1} & 0 & \dotsm& \binom{2k-2}{2k-4}Q_1 & 0 & Q_0\\ Q_{k} & 0 & \binom{2k-1}{1}Q_{k-1} & \dotsm& 0 & \binom{2k-1}{2k-3}Q_1 & 0 \end{vmatrix}\\ &=\begin{vmatrix} e_{i,j} \end{vmatrix}_{2k\times2k}, \quad k\ge1,\\ e_{i,j}&=\begin{cases} 0, & (i,j)=(2\ell-1,1),\quad 1\le\ell\le k;\\ Q_\ell, & (i,j)=(2\ell,1),\quad 1\le\ell\le k;\\ 0, & 1\le i\le j-2\le2k-2;\\ 0, & i-j=2\ell, \quad 0\le\ell\le k-1;\\ \binom{i-1}{j-2}Q_{\ell}, & i-j=2\ell-1, \quad 0\le\ell\le k-1,\quad j\ge2, \end{cases}\\ Q_m&=\frac{2^{2m+2}\bigl(2^{2m+4}-1\bigr)}{(m+1)(m+2)(2m+1)(2m+3)}|B_{2m+4}|, \quad m\ge0, \end{align*} and $$B_{2m+4}$$ denotes the Bernoulli numbers generated by $$\begin{equation*} \frac{z}{\operatorname{e}^z-1}=\sum_{k=0}^\infty B_k\frac{z^k}{k!}=1-\frac{z}2+\sum_{k=1}^\infty B_{2k}\frac{z^{2k}}{(2k)!}, \quad |z|<2\pi. \end{equation*}$$ As corollaries of the above Maclaurin power series expansion, we deduce the series expansions $$\begin{equation*} \ln(\tan x-x)=-\ln3+3\ln x-\sum_{k=1}^{\infty}\frac{3^{2k}D_{2k}}{(2k)!}x^{2k}, \quad 0 and $$\begin{equation*} \ln\biggl(\frac{\tan x}{x}-1\biggr) =-\ln3+2\ln|x|-\sum_{k=1}^{\infty}\frac{3^{2k}D_{2k}}{(2k)!}x^{2k}, \quad 0<|x|<\frac{\pi}{2}. \end{equation*}$$ Since the Bernoulli numbers can be expressed by closed-form formulas, so the sequence $$D_{2k}$$ is surely a closed-form formula.

About closed-form formulas for the Bernoulli numbers and about some conclusions on the tangent function, I would like to recommend the following papers.

References

1. Xue-Yan Chen, Lan Wu, Dongkyu Lim, and Feng Qi, Two identities and closed-form formulas for the Bernoulli numbers in terms of central factorial numbers of the second kind, Demonstratio Mathematica 55 (2022), no. 1, 822--830; available online at https://doi.org/10.1515/dema-2022-0166.
2. Feng Qi and Jacques Gelinas, Revisiting Bouvier's paper on tangent numbers, Advances and Applications in Mathematical Sciences 16 (2017), no. 8, 275--281.
3. Feng Qi and Bai-Ni Guo, An explicit formula for derivative polynomials of the tangent function, Acta Universitatis Sapientiae Mathematica 9 (2017), no. 2, 348--359; available online at https://doi.org/10.1515/ausm-2017-0026.
4. Feng Qi, Derivatives of tangent function and tangent numbers, Applied Mathematics and Computation 268 (2015), 844--858; available online at https://doi.org/10.1016/j.amc.2015.06.123.
5. Jiao-Lian Zhao, Qiu-Ming Luo, Bai-Ni Guo, and Feng Qi, Remarks on inequalities for the tangent function, Hacettepe Journal of Mathematics and Statistics 41 (2012), no. 4, 499--506.
6. Chao-Ping Chen and Feng Qi, A double inequality for remainder of power series of tangent function, Tamkang Journal of Mathematics 34 (2003), no. 4, 351--355; available online at https://doi.org/10.5556/j.tkjm.34.2003.236.
7. https://math.stackexchange.com/a/4248328
8. https://math.stackexchange.com/a/4248341
9. https://math.stackexchange.com/a/4248488
10. https://math.stackexchange.com/a/4254493
11. https://math.stackexchange.com/a/4254500
12. https://math.stackexchange.com/a/4256893
13. https://math.stackexchange.com/a/4256913
14. https://math.stackexchange.com/a/4256915
15. https://math.stackexchange.com/a/4656534
• What is the use of this expansion? Commented Apr 10, 2023 at 5:45
• At the beginning, I wish to find the series expansion of the function $f(x)$ for proving the function $$\frac{\ln\frac{3(\tan x-x)}{x^3}}{\ln\frac{\tan x}{x}} =\frac{\ln\bigl[\frac{3}{x^2}\bigl(\frac{\tan x}{x}-1\bigr)\bigr]}{\ln\frac{\tan x}{x}}$$ to be decreasing from $\bigl(0,\frac{\pi}{2}\bigr)$ onto $\bigl(1,\frac{6}{5}\bigr)$. Till now I am not successful to prove the monotonicity yet. The question at mathoverflow.net/q/444490 is an alternative try to prove the monotonicity which was guessed by a colleague last week. Commented Apr 10, 2023 at 13:22
• This answer is too complicated for me to prove that the function $$\frac{\ln\frac{3(\tan x-x)}{x^3}}{\ln\frac{\tan x}{x}} =\frac{\ln\bigl[\frac{3}{x^2}\bigl(\frac{\tan x}{x}-1\bigr)\bigr]}{\ln\frac{\tan x}{x}}$$ is decreasing from $\bigl(0,\frac{\pi}{2}\bigr)$ onto $\bigl(1,\frac{6}{5}\bigr)$. It would be more possible for sufficiently presenting a proof of the monotonicity if the determinant $D_{2k}$ is simplified in some form. Commented Apr 10, 2023 at 13:48
• After getting the Maclaurin power series expansion of the function $f(x)$ in this answer, which, in my opinion, is much beautiful in mathematics, the next problem is: how to compute or expand the determinant $D_{2k}$ of a Hessenberg matrix (en.wikipedia.org/wiki/Hessenberg_matrix) in a simple form? Commented Apr 11, 2023 at 14:18
• You can reduce the matrix size from $2k \times 2k$ to $k \times k$ by rearranging the rows and columns, first the odd and then the even rows/cols. The resulting $2 \times 2$ block diagonal matrix has one trivial and one non-trivial determinant. Commented Apr 11, 2023 at 17:36

This is not a complete answer for your question but just a key idea, I have used the first terms evaluated above by @ David E Speyer i have got the following discrete plot:

Using Mathematica the inverse series of the first 10 terms given by the following formula

$$O\left(\left(\sqrt{\frac{5}{2}} \sqrt{x-\log \left(\frac{x^3}{3}\right)}\right)^{10}\right)+\frac{47503588337 \left(\sqrt{\frac{5}{2}} \sqrt{x-\log \left(\frac{x^3}{3}\right)}\right)^9}{1601901100800000}-\frac{107033 \left(\sqrt{\frac{5}{2}} \sqrt{x-\log \left(\frac{x^3}{3}\right)}\right)^7}{181104000}+\frac{271 \left(\sqrt{\frac{5}{2}} \sqrt{x-\log \left(\frac{x^3}{3}\right)}\right)^5}{30240}-\frac{43}{420} \left(\sqrt{\frac{5}{2}} \sqrt{x-\log \left(\frac{x^3}{3}\right)}\right)^3+\sqrt{\frac{5}{2}} \sqrt{x-\log \left(\frac{x^3}{3}\right)}.$$

I'm not sure if there is such closed formula for your series expansion, but one can use polynomial approximation of the function $$\tan(x)$$ (second order) around $$x=0$$ and
using Inverse Fourier Transform one can get closed form by means of trigonometric functions and gamma function as: $$-3 i^n \Gamma (n) \left| x\right| ^{-n} \left(\cos \left(\frac{\pi n}{2}\right)+i \sin \left(\frac{\pi n}{2}\right) \text{sgn}(x)\right).$$

• i claimed that no closed form ,just i apprximated the tan function arround 0 then i got the last formula using inverse fourier transform .you should know that is wasting of time to search for such closed form regarding your given function Commented Apr 7, 2023 at 20:37
• I have obtained a closed-form expression for the general term of all coefficients in the Maclaurin power series expansion of the function $\ln\bigl(\frac{\tan x}{x}-1\bigr)$, or $\ln(\tan x-x)$, or $\ln\frac{3(\tan x-x)}{x^3}=\ln\bigl[\frac{3}{x^2}\bigl(\frac{\tan x}{x}-1\bigr)\bigr]$. So I think that your claim is wrong. @zeraoulia-rafik Commented Apr 8, 2023 at 1:52
• Are you sure that your picture is correct? Usually when Mathematica produces an image with a red background like that, it is indicating that there is an error in the code that produced it. Commented Apr 10, 2023 at 12:57