A few months ago I was messing around with integrals of the form $$\int\limits_{-\infty}^\infty{\frac{\cos x}{x^{2n}+1}dx}\text{ ,where }n\in\mathbb{N}$$ You can use the residue theorem to get that the value is $$\frac {-i\pi} n\sum_{k=0}^{n-1}{e^{\frac{\pi i(2k+1)}{2n}+ie^{\frac{\pi i(2k+1)}{2n}}}}$$ This can be simplified to $$\frac \pi n \sum_{k=0}^{n-1}{\sin\left(\frac{\pi(2k+1)}{2n}+\cos\left(\frac{\pi(2k+1)}{2n}\right)\right)e^{-\sin\left(\frac{\pi(2k+1)}{2n}\right)}}$$ which is the simpliest form of the sum I could come up with. Note that deriving this formula is not what I am asking in this question. I wonder if this can be simplified further.
Using this formula to evaluate the first few integrals gives the following: $$\int\limits_{-\infty}^\infty{\frac{\cos x}{x^2+1}dx} = \frac \pi e$$ $$\int\limits_{-\infty}^\infty{\frac{\cos x}{x^4+1}dx} = \pi \frac{\sin{\left(\frac{1}{\sqrt2}\right)}+\cos{\left(\frac{1}{\sqrt2}\right)}}{\sqrt 2 e^{\frac{1}{\sqrt 2}}}$$ $$\int\limits_{-\infty}^\infty{\frac{\cos x}{x^6+1}dx} = \pi \frac{1+\sqrt{3e}\sin{\left(\frac{\sqrt3}{2}\right)}+\sqrt{e}\cos{\left(\frac{\sqrt 3}{2}\right)}}{3 e}$$ I can not find any way to simplify any 'higher' integral to a "nice" form like the first three. For example, if you evaluate $n=4$ with the formula you get this expression: $$\frac{\pi}{2}\left(e^{-\sin\left(\frac{\pi}{8}\right)}\sin\left(\frac{\pi}{8}+\cos\left(\frac{\pi}{8}\right)\right)+e^{-\sin\left(\frac{3\pi}{8}\right)}\sin\left(\frac{3\pi}{8}+\cos\left(\frac{3\pi}{8}\right)\right)\right)$$ Sure, you can expand the sine and cosine expressions but it does not really help that much because of the exponents of $e$.
I tried plugging the $n=4$ integral into several computer algebra systems such as wolframalpha but none of them were able to give a simple expression of the value. In fact, if I got a value at all, the expressions were incredibly long and had a lot of complex numbers within them (which should not be there if it was simplified since it is a real integral). Therefore, I do not believe that there is an explicit form, but I am curious if anybody here has any ideas. This type of math is quite new to me, so it is probable that I have missed something obvious lol. Thanks in advance.
Pi/(n*I)*sum(exp(Pi*I*(2*k+1)/(2*n)+I*exp(Pi*I*(2*k+1)/(2*n))),k=0..n-1); simplify(eval(%,n=4)); latex(%);yields a manifestly real expression for $n = 4$: $$\frac{\pi \left({\mathrm e}^{-\sin \left(\frac{\pi}{8}\right)} \sin ! \left(\frac{\pi}{8}+\cos ! \left(\frac{\pi}{8}\right)\right)+{\mathrm e}^{-\sin \left(\frac{3 \pi}{8}\right)} \sin ! \left(\frac{3 \pi}{8}+\cos ! \left(\frac{3 \pi}{8}\right)\right)\right)}{2} .$$ – Travis Willse Jan 02 '25 at 20:32nand $n\neq 0$ solution is:,using Mathematica code:\[Pi] FoxH[{{{0, 1}, {2 n, -2 n}}, {{n, -n}}}, {{{0, 1}}, {{n, -n}}}, 1] + \[Pi] FoxH[{{{0, -2 n}, {1, 1}}, {{0, -n}}}, {{{1, 1}}, {{0, -n}}}, (-1)^(-2 n)]. – Mariusz Iwaniuk Jan 02 '25 at 21:30