28

Yesterday I took part in an entry competition to one of the MSc programs in my university, and during one of the mathematical tests, I had to solve some integral and differential equations.

One of those integrals had the following trigonometric form: $$ I(0,\pi)= \int\limits_0^\pi\left[\cos^2(\cos(x))+\sin^2(\sin(x))\right]dx $$ Unfortunately, I didn’t manage to solve it analytically during the test, but later, as I came home, I tried to evaluate it numerically using Mathematica. As it turned out, the answer seems to be $I(0,\pi)=\pi$.

Still, I do not understand what transformations or substitutions I had to perform so that to solve this problem analytically during the exam. This is exactly the reason, I am posting my question here, as I haven’t found this kind of problem even posted or solved anywhere yet, and so I am kindly asking for any help to attempt this integral analytically.

Thank you in advance!

Prem
  • 9,669
o.spectrum
  • 1,170
  • 8
  • 19
  • 5
    Do you mean $\left[\cos(\cos(x))\right]^2+\left[\sin(\sin(x))\right]^2$ or $\cos\left[(\cos(x))^2\right]+\sin\left[(\sin(x))^2\right]$ ? If it is the first one, then I guess the answer is quite obviously $\pi$... – TheSilverDoe Jun 20 '23 at 10:20
  • 5
    Both Cases are not Obvious to me , @TheSilverDoe , It might be Obvious when the Outer $\sin$ & $\cos$ have Same argument which is not true here. – Prem Jun 20 '23 at 10:32
  • 3
    @Prem Oops, indeed, nothing obvious here. But my first question still stands... – TheSilverDoe Jun 20 '23 at 10:34
  • 1
    I checked the 2 Cases & figured out which way we get $\pi$ , @TheSilverDoe , I updated the Question to match that. – Prem Jun 20 '23 at 10:45
  • 3
    @o.spectrum FYI, an Approach0 search found multiple AoPS threads for your integral, but only with an upper bound of $\frac{\pi}{2}$, e.g., Sine of sine and cosine of cosine, Fun integral, Integral, ... – John Omielan Jun 20 '23 at 11:20
  • 1
    @JohnOmielan oh wow, thank you so much! I didn’t even know about such a source, it seems like it will help me a lot in the future! – o.spectrum Jun 20 '23 at 12:36
  • 2
    Mathematica seems to be unable to solve the general integral, if there is no known closed formula, the proof probably had to rely on the particular choice of the interval $[0,\pi]$ which guides exploration to "what tricks can I use that involve $\pi$ $\cos$ and $\sin$ to integrate this". A youtube video I saw mentioned that these kinds of integrals with definite bounds often have a solution using the "king's property" (https://math.stackexchange.com/q/3856735/1049002) and so seeing that "it looks too complicated" and the definite bounds, my mind went to "looks like a king's property" – userrandrand Jun 21 '23 at 20:03
  • about searching for fomulas online, there was this question about it but I do not know much about the last answer at the bottom https://math.meta.stackexchange.com/q/10169/1049002 – userrandrand Jun 21 '23 at 21:33

5 Answers5

48

\begin{align*} I&= \int_0^\pi \cos^2\cos x+\sin^2\sin x \, dx\\ &= 2\int_0^{\pi/2} \cos^2\cos x+\sin^2\sin x \, dx\\ &= 2\int_0^{\pi/2} \cos^2\sin x+\sin^2\cos x \, dx \quad(x\mapsto\pi/2-x)\\ \end{align*} Hence $$ 2I=2\int_0^{ \pi/2 } 2\, dx\Rightarrow I=\pi $$ from summing the last two lines.

goonfiend
  • 2,759
  • Could you please motivate why it is obvious that $\int_0^{\pi}=2\int_0^{\frac{\pi}{2}}$ – Zima Jun 20 '23 at 10:55
  • 11
    Because the integrand is invariant under $x\mapsto \pi-x$, i.e. symmetric about $x=\pi/2$. – goonfiend Jun 20 '23 at 10:59
  • 1
    @Goonfiend oh, what an answer! Thank you so much. Now I feel awkward for not noticing that we can transform the arguments so that for them to match what further allows for the Pythagorean identity to be applied. At least now I finally see it, maybe the cause was that I was short on time during the exam. Anyways, thank you for this beautiful answer once again! – o.spectrum Jun 20 '23 at 12:44
  • I am adding the @ for @Zima so that they get a notification about Goonfiend's reply. – userrandrand Jun 21 '23 at 19:36
  • If you split over the $+$, apply the $x \mapsto \pi/2 - x$ substitution only to the second half of the integral ($\sin^2 \sin x$), and combine again, you end up with $2\int_0^{\pi/2} \cos^2 \cos x + \sin^2 \cos x\ dx = 2\int_0^{\pi/2} 1\ dx = 2\tfrac\pi2 = \pi$ without needing to double. – tomsmeding Jun 21 '23 at 20:33
  • @userrandrand thank you – Zima Jun 21 '23 at 20:53
  • 1
    @tomsmeding then you have different bounds on each piece, $[0,\pi]$ and $[-\pi/2,\pi/2]$, how will you combine again without using symmetry ? – userrandrand Jun 21 '23 at 21:17
  • @userrandrand er, like this? https://tomsmeding.com/ss/get/tomsmeding/Pn2jve I am using symmetry in the same way as Goonfiend, but then being more frugal in applying the substitution. – tomsmeding Jun 22 '23 at 07:02
17

A slightly different approach :

\begin{align*} I&= \int_0^\pi \cos^2\cos x+\sin^2\sin x \, dx\\ & = \int_0^\pi \dfrac{1+\cos(2\cos(x))}{2} + \dfrac{1-\cos(2\sin(x))}{2} dx \\ & = \pi + \dfrac{1}{2} \left( \int_0^\pi \cos(2 \cos(x)) dx - \int_0^\pi \cos(2 \sin(x)) dx\right) \\ \end{align*}

But notice that \begin{align*} \int_0^\pi \cos(2 \cos(x)) dx & = \int_0^{\pi/2} \cos(2 \cos(x)) dx + \int_{\pi/2}^\pi \cos(2 \cos(x)) dx \\ & = \int_{\pi/2}^{\pi} \cos(2 \sin(u)) du + \int_0^{\pi/2} \cos(2 \sin(t)) dt \\ & \quad \quad \quad \quad \quad \quad \quad (\text{substituting } u=x + \dfrac{\pi}{2} \text{ and } t=x- \dfrac{\pi}{2})\\ & = \int_0^{\pi} \cos(2 \sin(x)) dx \end{align*}

and you are done.

TheSilverDoe
  • 29,720
14

Let's take a completely different approach. Set

$$f(x)=\cos^2\cos x+\sin^2\sin x-1.$$

We will show that $f$ integrates to $0$ over $[0,\pi]$. Observe that

\begin{align*} f\left(x+\frac{\pi}{2}\right) &=\cos^2\cos\left(x+\frac{\pi}{2}\right)+\sin^2\sin\left(x+\frac{\pi}{2}\right)-1\\ &=\cos^2\sin x+\sin^2\cos x-1\\ &=\left(1-\sin^2\sin x\right)+\left(1-\cos^2\cos x\right)-1 \\ &=1-\cos^2\cos x-\sin^2\sin x\\ &=-f(x). \end{align*}

Indeed this property alone is enough to show the result, as then

\begin{align*} \int_0^\pi f(x)~\mathrm{d}x &=\int_0^\frac{\pi}{2} f(x)~\mathrm{d}x+\int_\frac{\pi}{2}^\pi f(x)~\mathrm{d}x \\ &=\int_0^\frac{\pi}{2} f(x)~\mathrm{d}x+\int_0^\frac{\pi}{2} f\left(x+\frac{\pi}{2}\right)~\mathrm{d}x \\ &=\int_0^\frac{\pi}{2}(f(x)-f(x))~\mathrm{d}x \\ &=0. \end{align*}

The result in the question now follows by observing that

$$\int_0^\pi\bigl(\cos^2\cos x+\sin^2\sin x\bigr)~\mathrm{d}x=\underbrace{\int_0^\pi f(x)~\mathrm{d}x}_{=0}+\underbrace{\int_0^\pi\mathrm{d}x}_{=\pi}=\pi.$$

Lorago
  • 9,239
7

Under $\cos x\to x$, one has \begin{align*} I&= \int_0^\pi (\cos^2\cos x+\sin^2\sin x) \, dx\\ & = \int_{-1}^1 \dfrac{\cos^2x+\sin^2(\sqrt{1-x^2})}{\sqrt{1-x^2}} dx \\ & = 2\int_{0}^1 \dfrac{\cos^2x+\sin^2(\sqrt{1-x^2})}{\sqrt{1-x^2}} dx. \end{align*} Noting that, under $\sqrt{1-x^2}\to x$, one has $$\int_{0}^1 \dfrac{\sin^2(\sqrt{1-x^2})}{\sqrt{1-x^2}} dx=\int_{0}^1 \dfrac{\sin^2x}{\sqrt{1-x^2}} dx$$ and hence $$ I=2\int_{0}^1 \dfrac{\cos^2x+\sin^2x}{\sqrt{1-x^2}} dx=2\int_{0}^1 \dfrac{1}{\sqrt{1-x^2}} dx=\pi. $$

user577215664
  • 40,625
xpaul
  • 44,000
2

Here is a method using Bessel functions. This is most likely not viable in a competition, but if you know the expansions and realize the simplifications due to the $\sin(2\pi k)$ factor, it may work. $$\begin{align*} I(0,\pi)&=\int_0^\pi\cos^2(\cos x)+\sin^2(\sin x)\ dx \\ &=\int_0^\pi\cos^2(\cos x)\ dx+\int_0^\pi\sin^2(\sin x)\ dx \\ &=\int_0^\pi\frac{1+\cos(2\cos x)}{2}\ dx+\int_0^\pi\frac{1-\cos(2\sin x)}{2}\ dx\\ &=\pi+\frac{1}{2}\underbrace{\int_0^\pi\cos(2\cos x)\ dx}_{I_1}-\frac{1}{2}\underbrace{\int_0^\pi\cos(2\sin x)\ dx}_{I_2} \end{align*}$$ Using two Jacobi-Anger expansions, $$\cos(2\cos x)=J_0(2)+2\sum_{k=1}^\infty(-1)^kJ_{2k}(2)\cos(2kx),\quad x\in\mathbb{C} \\ \cos(2\sin x)=J_0(2)+2\sum_{k=1}^\infty J_{2k}(2)\cos(2kx),\quad x\in\mathbb{C}$$ we have for $I_1$, $$\begin{align*}I_1&=\int_0^\pi J_0(2)+2\sum_{k=1}^\infty(-1)^kJ_{2k}(2)\cos(2kx)\ dx \\&=\pi J_0(2)+2\sum_{k=1}^\infty(-1)^kJ_{2k}(2)\int_0^\pi\cos(2kx)\ dx\\ &=\pi J_0(2)+2\sum_{k=1}^\infty\frac{(-1)^kJ_{2k}(2)\sin(2\pi k)}{k} \\&=\pi J_0(2) \end{align*}$$ and for $I_2$, $$\begin{align*} I_2&=\int_0^\pi J_0(2)+2\sum_{k=1}^\infty J_{2k}(2)\cos(2kx)\ dx \\ &=\pi J_0(2)+2\sum_{k=1}^\infty J_{2k}(2)\int_0^\pi\cos(2kx)\ dx \\ &=\pi J_0(2)+2\sum_{k=1}^\infty\frac{J_{2k}(2)\sin(2\pi k)}{k} \\ &=\pi J_0(2) \end{align*}$$ thus the integral is, $$I(0,\pi)=\pi+\frac{\pi }{2}J_0(2)-\frac{\pi}{2}J_0(2)=\pi.$$


Another solution, this time utilizing the Maclaurin expansion of $\cos(x)$. As we end up finding closed forms in terms of the Bessel function anyways, I will merge answers.

Working similarly as above, $$\begin{align*} I(0,\pi)&=\pi+\frac{1}{2}\underbrace{\int_0^\pi\cos(2\cos x)\ dx}_{I_1}-\frac{1}{2}\underbrace{\int_0^\pi\cos(2\sin x)\ dx}_{I_2} \end{align*}$$ expanding the cosine by its Maclaurin series, $$I_1=\int_0^\pi\sum_{k=0}^\infty\frac{(-1)^k2^{2k}}{(2k)!}\cos^{2k}(x)\ dx=\sum_{k=0}^\infty\frac{(-1)^k2^{2k}}{(2k)!}\int_0^\pi\cos^{2k}(x)\ dx=\pi\sum_{k=0}^\infty\frac{(-1)^k}{(k!)^2}=\pi J_0(2)$$ $$I_2=\int_0^\pi\sum_{k=0}^\infty\frac{(-1)^k2^{2k}}{(2k)!}\sin^{2k}(x)\ dx=\sum_{k=0}^\infty\frac{(-1)^k2^{2k}}{(2k)!}\int_0^\pi\sin^{2k}(x)\ dx=\pi\sum_{k=0}^\infty\frac{(-1)^k}{(k!)^2}=\pi J_0(2)$$ here I used the Wallis integrals, $$\int_0^\pi\cos^{2k}(x)\ dx=\int_0^\pi\sin^{2k}(x)\ dx=\frac{\pi}{2^{2k}}\binom{2k}{k},\quad k\in\mathbb{Z_0}$$ and the series expansion for the Bessel function of first kind, $$J_0(z)=\sum_{k=0}^\infty\frac{(-1)^k}{(k!)^2}\left(\frac{z}{2}\right)^{2k},\quad z\in\mathbb{C}$$ hence by similar arguments, $$I(0,\pi)=\pi.$$

bob
  • 2,167