Why doesn't every integral from 0 to $2\pi$ equal zero?

Quick question, might end up having a simple answer, but I have here a "proof" that any integral from 0 to $2\pi$ is zero, as follows:

$$\int^{2\pi}_0f(x)dx$$

Now using u-substitution, let $u = \sin x$, so $dx = \frac{du}{\cos x}$, so:

$$\int^{0}_{0}\frac{f(x)du}{\cos x}$$

(The bounds were evaluated to zero due to the u-substituion).

However, this is zero, since the integral goes from zero to zero.

Any help as to why this is wrong would be appreciated.

• Sometimes Maple or Mathematica will produce wrong answers because they did something like this... But people should think before they act... – GEdgar Jan 12 '15 at 16:17
• $\int_{a}^{b} f(x) dx = 0$, make the substitution $t = (x-a)(x-b)$... – Aryabhata Jan 12 '15 at 17:24

the $\sin$ function is not injective on $[0 ; 2\pi]$ so you may not be able to do such a substitution. Since you cannot readily give an inverse, you may have some difficulty expressing everything in terms of $u$.

In your case, the $\cos(x)$ term that appears from the change of variable cannot be expressed only in terms of $u = \sin(x)$, so the thing you are integrating "from $0$ to $0$" is not even a function of $u$ :

$\cos(x)$ is either $+\sqrt{1-u^2}$ or $-\sqrt{1-u^2}$ where the sign depends on $x$ (and not on $u$), and so $\sin(x)dx$ is not of the form $f(\sin(x))\cos(x)dx$ for any function $f$.

To resolve this you can split the integral in three parts (splitting the interval at $\pi/2$ and $3\pi/2$) and do $3$ separate substitutions and you will obtain something true but mostly useless.

Thanks to the user @m_t_ for pointing out that in case this doesn't happen, the substitution rule is applicable.

• There's no requirement for substitutions to be injective. $u=\sin(x)$ is a legitimate substitution in $\int _a^b \sin(x)^2 \cos(x) dx$ for any $a,b$, and more generally $\int _{g(a)}^{g(b)} f(u)du = \int _a^b f(g(x))g'(x) dx$ for any continuous $g$ with $g'$ also continuous. – Matthew Towers Oct 22 '17 at 18:12
• Failure of injectivity may stop us expressing $f(x)/\cos⁡(x)$ in terms of $u$, but you might edit this answer to avoid giving the impression we always need $g$ to be injective to make a substitution $u=g(x)$. – Matthew Towers Oct 22 '17 at 19:07

let's do it carefully. $$A = \int_0^{2\pi} f(x)\,dx$$ Use the substitution $u = \sin x$.

We need to compute $x$ in terms of $u$. Well, $x = \arcsin u$, but that only holds for $-\pi/2 \le x \le \pi/2$. Outside that interval, you will have other formulas for $x$ in terms of $u$.

What about computing $dx$? Either $dx = \frac{du}{\sqrt{1-u^2}}$ or $dx = \frac{-\, du}{\sqrt{1-u^2}}$, depending on whether we are in an interval where $\sin x$ is increasing or decreasing.

So your result is not as simple as you thought.

• But why does it matter what x is? Wouldn't the integral be zero regardless of how complex the integrand is? – Cisplatin Jan 12 '15 at 16:21
• For more, see robjohn's answer. The three integrands he shows are different. The three integrals do not add to zero... Despite the fact that the first one starts at $0$ and the last one ends at $0$. – GEdgar Jan 12 '15 at 20:53

Write the integral in terms of $u=\sin(x)$. To avoid the places where $\sin(x)$ is not $1{-}1$, we need to break up the integral: \begin{align} \int_0^{2\pi}f(x)\,\mathrm{d}x &=\int_0^1\frac{f(\arcsin(u))}{\sqrt{1-u^2}}\,\mathrm{d}u\\ &-\int_1^{-1}\frac{f(\pi-\arcsin(u))}{\sqrt{1-u^2}}\,\mathrm{d}u\\ &+\int_{-1}^0\frac{f(2\pi+\arcsin(u))}{\sqrt{1-u^2}}\,\mathrm{d}u\\ \end{align} The minus sign in the integral from $1$ to $-1$ is because we need the negative of the square root to get the proper $\cos(x)$.

If we don't pay close attention to the mapping between $x$ and $u$, we can be lead into the fallacy that you suggest.

Note carefully that you're doing an "inverse" substitution "$u = \sin x$", not an "ordinary (or $u$-)substitution" of the form $x = X(u)$. For your conclusion to follow from the change of variables theorem, you'd need $$\int_{0}^{2\pi} f(x)\, dx = \int_{0}^{0} g(u)\, du$$ for some function $g$. Your argument proposes "solving" $f(x) = g(\sin x) \cos x$ for $g$, so that $$\int_{a}^{b} \underbrace{g\bigl(u(x)\bigr) u'(x)}_{f(x)}\, dx = \int_{u(a)}^{u(b)} g(u)\, du.$$ But despite casual appearances, there is no such function $g$ because, as mercio says, your substitution isn't invertible (injective).

In symbols, you want to write $$g(u) = \frac{f(\arcsin u)}{\cos x} = \frac{f(x)}{\cos x}.$$ However, $\arcsin(\sin x) \neq x$ if $|x| > \pi/2$, so this formal choice doesn't work.

Said another way, the function $\phi(x) = g(\sin x) \cos x$ satisfies the non-trivial symmetry $\phi(\frac{\pi}{2} - x) = -\phi(x)$ for all $x$ ($\phi$ is "odd with respect to $\frac{\pi}{2}$"), while $f$ need not.

Either way, if $f$ is given there is generally no $g$ such that $f(x) = g(\sin x) \cos x$, so your proof doesn't get off the ground.