# What is the value of $\int^\infty_{-\infty} \cos^2 x\, dx$?

For the given expression, I can make the following steps:

$$\int^\infty_{-\infty} \cos^2x \,dx = \frac{1}{2}\int^\infty_{-\infty} \cos 2x\, + 1\, dx\\ \hspace{19mm}= \frac{1}{2} \left\{ \frac{1}{2}\sin2x + x \right\}\bigg\rvert^\infty_{-\infty}\\ \hspace{13mm}= \frac{1}{4} \sin2x \, \bigg\rvert^\infty_{-\infty} + x\,\bigg\rvert_{\infty}$$

I understand that $\lim_{x \rightarrow 0} \sin x$ is not defined. Thus the last line indicates that the integral is not defined.

Given that $1 \geq \cos^2 x \geq 0\, \forall \, x \in \mathbb{R}$. Should not the integral be $\infty$ instead of not defined?

• Where did the $x$ in your second line go? – Arthur Jun 29 '18 at 9:01
• Why did you kill the "$+x$" in the last equality? – Crostul Jun 29 '18 at 9:01
• my apologies for missing out the last term, I have made an edit – Tian Jun 29 '18 at 9:04

$\int _{2k\pi } ^{2(k+1)\pi } \cos ^{2} (x) \, dx =\pi$. Add these integrals over $k$.
Note that$$\int_{-\infty}^{+\infty}\cos^2(x)\,\mathrm dx=\int_0^{+\infty}\cos^2(x)\,\mathrm dx+\int_{-\infty}^0\cos^2(x)\,\mathrm dx.$$This way, you can prove that integral $\int_0^{+\infty}\cos^2(x)\,\mathrm dx$ and $\int_{-\infty}^0\cos^2(x)\,\mathrm dx$ is indeed $+\infty$.