2

Is the following integration correct?

Consider the integral $\int_{-\pi}^\pi \frac{\cos(x)}{5+\sin(x)^2} dx$. Substitute $y = \sin(x)$ then we have $\frac{dy}{dx} = \cos(x)$ and hence $dy = \cos(x) dx$ and we get

$$\int_{-\pi}^\pi \frac{\cos(x)}{5+\sin(x)^2}dx = \int_{\sin(-\pi)}^{\sin(\pi)} \frac{1}{5+y^2}dy = \int_{0}^{0} \frac{1}{5+y^2}dy = 0.$$

The substitution seems a bit odd, but the result $0$ is correct. Thanks in advance :)

Yaddle
  • 5,246
  • If you frame it as a substitution, it's problematic. But there's no problem if you use the fundamental theorem of calculus on $$\int_{-\pi}^{\pi} (f\circ \sin)'(x),dx,$$ where $f$ is a function with $f'(y) = \frac{1}{5 + y^2}$ (e.g. $\frac{1}{\sqrt{5}} \arctan (y/\sqrt{5})$). – Daniel Fischer Oct 28 '16 at 18:39
  • Yes, your integration is perfectly fine. – mickep Oct 30 '16 at 07:34

4 Answers4

2

HINT:

The substitution $y=\sin(x)$ is not legitimate on $[-\pi,\pi]$ since the sine function does not have a unique inverse function there. However, the sine function does have a uniquely definable inverse on $[0,\pi/2]$.

Note that we have from even symmetry

$$\begin{align} \int_{-\pi}^\pi \frac{\cos(x)}{5+\sin^2(x)}\,dx&=2\int_0^{\pi}\frac{\cos(x)}{5+\sin^2(x)}\,dx\\\\ &=2\int_0^{\pi/2}\frac{\cos(x)}{5+\sin^2(x)}\,dx+2\int_{\pi/2}^\pi\frac{\cos(x)}{5+\sin^2(x)}\,dx \tag 1 \end{align}$$

Now the substitution $y=\sin(x)$ is legitimate on each of the integrals on the right-hand side of $(1)$.

Mark Viola
  • 184,670
  • 1
    I actually would like to do the substitution $u = \pi - x$ to just the second integral leaving you with $2\int_0^{\frac {\pi}{2}} \frac {cos x}{5+sin^2 x} dx- 2\int_0^{\frac {\pi}{2}} \frac {cos u}{5+sin^2 u} du = 0$ – Doug M Oct 28 '16 at 16:50
  • @DougM Sure; that is the easier way to go. – Mark Viola Oct 28 '16 at 16:51
  • I would use the formulas $\cos(x-\pi)=-\cos x$, $\sin^2(x-\pi)=\sin^2x$ to conclude that $\int_{-\pi}^0=-\int_0^\pi$ and be done with it. – Jyrki Lahtonen Oct 28 '16 at 17:07
  • 1
    @Dr.MV I never read that the function I'm substituting with needs to have a unique definable inverse. In every book I studied there was just needed that it is differentiable with a integrable derivative. – Yaddle Oct 28 '16 at 17:42
  • @yaddle When making the substitution $y=\sin(x)$, one is equivalently enforcing the substitution $x=\arcsin(y)$. – Mark Viola Oct 28 '16 at 20:43
  • The inverse is not needed to make the calculation work, Yaddle. – mickep Oct 30 '16 at 07:35
  • @mickep What does your comment mean? Are you suggesting that the inverse need not exist? – Mark Viola Oct 30 '16 at 19:14
  • @Dr.MV Indeed. This has been discussed on this site many times, see for example here. Doing the calculation as OP did it in the question is fine. – mickep Oct 30 '16 at 19:22
  • @micep I was referring to the substitution itself, which requires injectivity to be meaningful. However, as Daniel Fischer commented, one can directly apply the FOC directly and proceed. – Mark Viola Oct 30 '16 at 23:42
0

Hint:

$$\cos(x) = \cos(-x)\\\sin(x)=-\sin(-x)$$

Can you use this to find an appropriate symmetry?

Fimpellizzeri
  • 23,321
  • I am not sure where you are trying to suggest. That the function is an even function? That doesn't explain why the integral is 0. – Doug M Oct 28 '16 at 16:33
  • @DougM No, odd/even function does not answer this. But the integral from $0$ to $\pi$ and from $0$ to $-\pi$ in this orientation is the same, due to this symmetry (because the sine is squared). Now it's just a matter of reversing orientation on the second bit, which produces a sign change that cancels out the first bit. I tried not to spoil it too much but perhaps it ended up too vague. Did the explanation make sense? – Fimpellizzeri Oct 28 '16 at 16:48
0

Hint: split the integral into two pieces $-\pi$ to $0$ and $0$ to $\pi$. Note the point symmetry of the integrand for the points $P_1=(-\pi/2,0)$ and $P_2=(\pi/2,0)$. You can achieve this by substitution $x=u\pm \pi/2$ and $dx = du$. You should see that you will get odd functions after the substitutions, which both evaluate to $0$.


An alternative approach: Use the substitution $\sin(x)=\sqrt{5}u \implies \cos(x)dx=\sqrt{5}du$:

$$\int_{-\pi}^\pi \frac{\cos(x)}{5+\sin(x)^2}dx=\frac{1}{5}\int\frac{du}{1+u^2}=\frac{1}{5}\arctan(u)=\frac{1}{5}\arctan \left(\frac{\sin(x)}{\sqrt{5}}\right)\biggr|_{-\pi}^{\pi}=0$$

MrYouMath
  • 16,174
0

You are correct that the integral is 0.

To proceed with the integration:

do the substitution

$\sin x = \sqrt 5 \tan t\\ \cos x \;dx = \sec^2 t\; dt$

$\int_{-\pi}^{\pi} \frac {\cos x}{5 + \sin^2 x} dx = \frac 1{\sqrt5} \tan^{-1}(\sqrt 5 \sin x)|_{-\pi}^{\pi}$

Does that really help to explain why it integrates to 0? perhaps not.

The integrand is periodic with period $2\pi$, i.e. $f(x+2\pi) = f(x)$ and we are integrating over the full period.

Furthermore, over a full period, the wave spends equal time below the line as it does above the line. $f(x) = -f(x+\pi) = -f(x-\pi)$ For every point in the interval, there is a corresponding point where $f(a) = -f(b).$ And, that means that over any interval of $2\pi$ the integral will be $0.$

Doug M
  • 58,694