# Integral: $\int_{0}^{2\pi}\left|\sin\left(\left(n-1\right)x-\frac{\pi}{2n}\right)\cos\left(nx\right)\right|dx$

A little over a year ago, I was nerd-sniped by this integral from Problem 12271 of the American Mathematical Monthly. A PDF of the original source can be found here on the third page. Here is the proposal.

Let $$n$$ be a positive integer. Evaluate $$\displaystyle \int_{0}^{2\pi}\left|\sin\left(\left(n-1\right)\theta-\frac{\pi}{2n}\right)\cos\left(n\theta\right)\right|d\theta.$$

I realize that integral looks too crazy to have a closed form, but I believe there has to be an elementary closed form in terms of $$n$$ because on that PDF, there is no asterisk after the number 12271, which would mean an elementary closed form should be possible.

(Question): How do you solve this problem?

(Attempt): I used these two Fourier Series expressions to get rid of the absolute values:

$$\left|\sin x\right|=\frac{2}{\pi}-\frac{4}{\pi}\sum_{k=1}^{\infty}\frac{\cos\left(2kx\right)}{4k^{2}-1}$$

$$\left|\cos x\right|=\frac{2}{\pi}-\frac{4}{\pi}\sum_{m=1}^{\infty}\frac{\left(-1\right)^{m}\cos\left(2mx\right)}{4m^{2}-1}.$$

Then

\begin{align} I :=& \int_{0}^{2\pi}\left|\sin\left(\left(n-1\right)x-\frac{\pi}{2n}\right)\cos\left(nx\right)\right|dx \\ =& \int_{0}^{2\pi}\left(\frac{2}{\pi}-\frac{4}{\pi}\sum_{k=1}^{\infty}\frac{\cos\left(2k\left(\left(n-1\right)x-\frac{\pi}{2n}\right)\right)}{4k^{2}-1}\right)\left(\frac{2}{\pi}-\frac{4}{\pi}\sum_{m=1}^{\infty}\frac{\left(-1\right)^{m}\cos\left(2mnx\right)}{4m^{2}-1}\right)dx \\ =& \frac{16}{\pi^{2}}\sum_{k=1}^{\infty}\frac{1}{4k^{2}-1}\sum_{m=1}^{\infty}\frac{\left(-1\right)^{m}}{4m^{2}-1}\int_{0}^{2\pi}\cos\left(2knx-2kx-\frac{k\pi}{n}\right)\cos\left(2mnx\right)dx \\ &-\frac{8}{\pi^{2}}\sum_{k=1}^{\infty}\frac{1}{4k^{2}-1}\left(\frac{\sin\left(\frac{4\pi kn^{2}-4\pi kn-\pi k}{n}\right)+\sin\left(\frac{\pi k}{n}\right)}{2k\left(n-1\right)}\right) \\ &-\frac{8}{\pi^{2}}\sum_{m=1}^{\infty}\frac{\left(-1\right)^{m}\sin\left(4\pi mn\right)}{2mn\left(4m^{2}-1\right)}+\frac{8}{\pi}. \end{align}

Obviously, this is a mess. Even if this could somehow be simplified into a closed form, it doesn't seem like it works for $$n=1$$ because of $$\displaystyle \frac{\sin\left(\frac{4\pi kn^{2}-4\pi kn-\pi k}{n}\right)+\sin\left(\frac{\pi k}{n}\right)}{2k\left(n-1\right)}$$. I could make a separate case for $$n=1$$ and get $$I = 4$$, but it seems like the answer requires an expression that works for all positive integers $$n$$ and not cases.

(Another Attempt): Here is a Desmos link, and I made this in my final year of university in 2021. (My math professor gave the class an opportunity for extra credit if people in the class wanted to attempt the problem.) It's a bit hard to follow, but I basically partitioned the integral into multiple integrals by finding out where the expression inside the absolute values crossed the x-axis. If I remember correctly, I added all the positive areas and negative areas separately, then just slapped a negative sign in front of the sum of the negative areas. I don't remember how exactly I obtained some of the sums in that Desmos link. The answers I got in that link seem numerically correct for small values of $$n$$, but even with the scratch work I did in a separate notebook, it just seems like I magically pulled the sums out of nowhere. Plus, I'm sure the intended solution looks a lot cleaner. Please forgive me for not typing all of it into Mathjax; I don't want this post to be any longer than it should be.

NB: I have looked high and low on Google and Approach Zero for a solution, but it seems like there isn't one available. Additionally, this website doesn't seem to have the solution either. The only way I may possibly find the solution is if I subscribe to the AMM journal, which I don't have any interest in doing. As far as I know, I should be allowed to ask for a solution to this problem online because the due date for solutions was on December 31, 2021, so it shouldn't be an ongoing problem anymore.

• Beside the elagant solution given by @Conrad, $\cdots\cdots ????$ Commented Apr 28, 2023 at 9:53

## 1 Answer

Partial Answer - Reducing the integral to one in terms of the Chebyshev polynomials (Wolfram Alpha doesn't seem to have a nice closed form for $$n \ge 5$$)

$$2\sin ((n-1)\theta-\frac{\pi}{2n})\cos(n\theta)=\sin ((2n-1)\theta-\frac{\pi}{2n})-\sin (\theta +\frac{\pi}{2n})$$

Changing variables $$t=\theta +\frac{\pi}{2n}$$ and using periodicity we get that the integrand becomes $$\frac{1}{2}|\sin (2n-1)t+\sin t|=|\sin nt \cos (n-1)t|$$

Hence $$I=\int_0^{2\pi}|\sin nt \cos (n-1)t|dt=2\int_0^{\pi}|\sin nt \cos (n-1)t|dt$$

But now with the change of variables $$\cos t=x$$ we get that $$I=2\int_{-1}^{1}|U_{n-1}(x)T_{n-1}(x)|dx$$ where as usual $$T_n, U_n$$ are the Chebyshev polynomials

Using the multiplication formula $$2U_{n-1}(x)T_{n-1}(x)=1+U_{2n-2}(x)$$ (which can be seen from the trigonometric form easily as above) we get that $$I=\int_{-1}^{1}|1+U_{2n-2}(x)|dx$$

• This is superb, even shorter $$I=2\int_{0}^{1}|1+U_{2n-2}(x)|dx$$ Commented Apr 28, 2023 at 9:44