Solution of a meme integral: $\int \frac{x \sin(x)}{1+\cos(x)^2}\mathrm{d}x$

1k Views Asked by At

Context

A few days ago I saw a meme published on a mathematics page in which they joked about the fact that $$\int\frac{x\sin(x)}{1+\cos(x)^2}\mathrm{d}x$$ was very long (and they put a screen shot of the result obtained using Wolfram)

(I avoid posting the whole screen because it is actually very very long, just open this link.)

My work

However, out of curiosity I tried to do it and got the following result:

$${\color{blue}{\int_{0}^{x}\frac{t\sin(t)}{1+\cos(t)^2}\mathrm{d}t=-x\operatorname{tan^{-1}}(\cos(x))-2\sum_{n=1}^{\infty}(-1)^n\frac{(\sqrt{2}-1)^{2n-1}}{(2n-1)^2}\sin((2n-1)x)}}$$

Which is ridiculously shorter than the whole result Wolfram gives haha

Question

I would like to express the last series in terms of known functions, but I can't (I'm pretty sure it's the imaginary part of the dilogarithm, but I can't bring it back), could anyone help me?

I'll leave a link for Desmos if anyone wants to work on it.

1

There are 1 best solutions below

3
On

In the end I did it myself, it actually wasn't complicated, sorry.

$$-2\sum_{n=1}^{\infty}\left(-1\right)^{n}\frac{\left(\sqrt{2}-1\right)^{2n-1}}{\left(2n-1\right)^{2}}\sin\left(\left(2n-1\right)x\right)-x\operatorname{tan^{-1}}\left(\cos\left(x\right)\right)$$ $$2\sum_{n=1}^{\infty}\frac{\left(\sqrt{2}-1\right)^{2n-1}}{\left(2n-1\right)^{2}}\cos\left(\left(2n-1\right)\left(x-\frac{\pi}{2}\right)\right)-x\operatorname{tan^{-1}}\left(\cos\left(x\right)\right)$$ $$\sum_{n=1}^{\infty}\left(1-\left(-1\right)^{n}\right)\frac{\left(\sqrt{2}-1\right)^{n}}{n^{2}}\cos\left(n\left(x-\frac{\pi}{2}\right)\right)-x\operatorname{tan^{-1}}\left(\cos\left(x\right)\right)$$ $$\sum_{n=1}^{\infty}\frac{\left(\sqrt{2}-1\right)^{n}}{n^{2}}\cos\left(n\left(x-\frac{\pi}{2}\right)\right)-\sum_{n=1}^{\infty}\frac{\left(1-\sqrt{2}\right)^{n}}{n^{2}}\cos\left(n\left(x-\frac{\pi}{2}\right)\right)-x\operatorname{tan^{-1}}\left(\cos\left(x\right)\right)$$ $$\Re\left[\text{Li}_{2}\left(\left(\sqrt{2}-1\right)e^{i\left(x-\frac{\pi}{2}\right)}\right)-\text{Li}_{2}\left(\left(1-\sqrt{2}\right)e^{i\left(x-\frac{\pi}{2}\right)}\right)\right]-x\operatorname{tan^{-1}}\left(\cos\left(x\right)\right)$$

$$\Re\left[\text{Li}_{2}\left(i\left(1-\sqrt{2}\right)e^{ix}\right)-\text{Li}_{2}\left(i\left(\sqrt{2}-1\right)e^{ix}\right)\right]-x\operatorname{tan^{-1}}\left(\cos\left(x\right)\right)$$


$$\color{blue}{\int_{0}^{x}\frac{t\sin\left(t\right)}{1+\cos\left(t\right)^{2}}\mathrm{d}t=2\Im\left[\text{Ti}_2((\sqrt{2}-1)e^{ix})\right]-x\cdot\operatorname{tan^{-1}}(\cos(x))}$$

Where:


Update: related additional formula

$$\color{blue}{\begin{align}\int\operatorname{tan^{-1}}(\cos(x))x^n\mathrm{d}x=&2n!\sum_{k=0}^{n}\left(-1\right)^{\left\lfloor\frac{k}{2}\right\rfloor}\frac{x^{n-k}}{\left(n-k\right)!}\cdot\begin{cases} \Re\left[\text{Ti}_{k+2}\left(\left(\sqrt{2}-1\right)e^{ix}\right)\right] &k\text{ is odd}\\ \Im\left[\text{Ti}_{k+2}\left(\left(\sqrt{2}-1\right)e^{ix}\right)\right]&k\text{ is even}\end{cases}\\ =&2n!\sum_{k=0}^{n}\frac{x^{n-k}}{(n-k)!}\Im\left[i^k\cdot\text{Ti}_{k+2}\left(\left(\sqrt{2}-1\right)e^{ix}\right)\right]\end{align}}$$

It is related because: $$\int_{0}^{x}\frac{t^{n}\sin\left(t\right)}{1+\cos\left(t\right)^{2}}dt=-\operatorname{tan^{-1}}\left(\cos\left(x\right)\right)x^{n}+\int_{0}^{x}\operatorname{tan^{-1}}\left(\cos\left(t\right)\right)t^{n-1}dt$$

Generalization

Let: $$\theta:=\frac{\sqrt{\alpha^2+1}-1}{\alpha}$$ Then: $$\color{blue}{\begin{align}\int\operatorname{tan^{-1}}(\alpha\cdot\cos(x))x^n\mathrm{d}x=&2n!\sum_{k=0}^{n}\left(-1\right)^{\left\lfloor\frac{k}{2}\right\rfloor}\frac{x^{n-k}}{\left(n-k\right)!}\cdot\begin{cases} \Re\left[\text{Ti}_{k+2}\left(\theta e^{ix}\right)\right] &k\text{ is odd}\\ \Im\left[\text{Ti}_{k+2}\left(\theta e^{ix}\right)\right]&k\text{ is even}\end{cases}\\ =&2n!\sum_{k=0}^{n}\frac{x^{n-k}}{(n-k)!}\Im\left[i^k\cdot\text{Ti}_{k+2}\left(\theta\cdot e^{ix}\right)\right]\end{align}}$$

The imaginary part can be computed with this serie: $$\Im\left[i^{n}\cdot\text{Ti}_{n+2}\left(\theta e^{ix}\right)\right]=-\sum_{k=1}^{\infty}\left(-1\right)^{k}\frac{\theta^{2k-1}}{\left(2k-1\right)^{n+2}}\sin\left(\left(2k-1\right)x+\frac{n\pi}{2}\right)$$

I implemented it on Desmos if anyone wants to have fun with it.


Update 2: related hyperbolic formula

Very small variation on the theme, just because maybe someone needs it and Wolfram gives this very long result

$$\color{blue}{\begin{align}\int\operatorname{tan^{-1}}\left(\cosh(x)\right)\mathrm{d}x=&\frac{\pi}{2}x+\Im\left[\text{Li}_{2}\left(i\left(\sqrt{2}-1\right)e^{x}\right)-\text{Li}_{2}\left(i\left(\sqrt{2}+1\right)e^{x}\right)\right]\\ =&\frac{\pi}{2}x+\text{Ti}_2\left(\left(\sqrt{2}+1\right)e^{-x}\right)-\text{Ti}_2\left(\left(\sqrt{2}-1\right)e^{-x}\right)\end{align}}$$

Generalization of hypergeometric formula

Let: $$\alpha>0\text{ and }\theta^{\pm}=\frac{\sqrt{\alpha^2+1}\pm1}{\alpha}$$

Then:

$$\color{blue}{\begin{matrix}\displaystyle\int\operatorname{tan^{-1}}\left(\alpha\cdot\cosh\left(x\right)\right)x^{n}\mathrm{d}x=\frac{\pi}{2}\cdot\frac{x^{n+1}}{n+1}+n!\sum_{k=0}^{n}\frac{x^{n-k}}{\left(n-k\right)!}\left(\text{Ti}_{k+2}\left(\theta^{+}e^{-x}\right)-\text{Ti}_{k+2}\left(\theta^{-}e^{-x}\right)\right)\end{matrix}}$$

I implemented also it on Desmos if anyone wants to have fun with it.