$$\int_{-\pi}^{\pi}\frac{\sin x}{1+x^2} dx$$
$$\int_{-\pi}^{\pi}\frac{\cos x}{1+x^2} dx$$
How do I evaluate these two integrals? Are the approaches very different?
I seem to get lost while substituting.
$$\int_{-\pi}^{\pi}\frac{\sin x}{1+x^2} dx$$
$$\int_{-\pi}^{\pi}\frac{\cos x}{1+x^2} dx$$
How do I evaluate these two integrals? Are the approaches very different?
I seem to get lost while substituting.
Since $\sin$ is odd, the first integral reduces down to
$$\int_{-\pi}^\pi\frac{\sin(x)}{1+x^2}{\rm~d}x=0$$
For the second integral, note that:
$$\frac1{1+x^2}=\frac1{2i}\left[\frac1{x-i}-\frac1{x+i}\right]$$
And that$\newcommand{\cint}{\operatorname{Ci}}\newcommand{\sint}{\operatorname{Si}}$
\begin{align}\int_a^b\frac{\cos(x)}{x+c}{\rm~d}x&=\int_{a+c}^{b+c}\frac{\cos(x-c)}x{\rm~d}x\\&=\int_{a+c}^{b+c}\frac{\cos(x)\cos(c)+\sin(x)\sin(c)}x{\rm d}x\\&=\cos(c)(\cint(b+c)-\cint(a+c))+\sin(c)(\sint(b+c)-\sint(a+c))\end{align}
where $\cint$ and $\sint$ are trigonometric integrals.
And so, we reach a final closed form of:
$$\int_{-\pi}^\pi\frac{\cos(x)}{1+x^2}{\rm~d}x=2\int_0^\pi\frac{\cos(x)}{1+x^2}{\rm~d}x\\=i\big[\cos(i)(\cint(\pi+i)-\cint(\pi-i))-\sin(i)(\sint(\pi+i)+\sint(\pi-i))\big]$$
where we use some basic symmetries of $\cint$ and $\sint$ (even and odd, respectively).
If you wish to take it one step further, you'll get
$$\cos(i)=\cosh(1)=\frac{e+e^{-1}}2\\\sin(i)=i\sinh(1)=\frac{e-e^{-1}}2i$$
The first integral is obviously zero by parity, and the second integral is not an elementary integral but depends on the sine integral and cosine integral functions. On the other hand, numerical approximations are simple to derive, since
$$ \int_{0}^{\pi}\frac{\cos(x)}{1+x^2}\,dx = \int_{0}^{\pi/2}\cos(x)\left(\frac{1}{1+x^2}-\frac{1}{(\pi-x)^2}\right)\,dx $$
and over $\left(0,\frac{\pi}{2}\right)$ we have $\cos(x)\approx 1-\frac{4x^2}{\pi^2}$, for instance.
The second integral is approximately $\frac{11}{9}$.