# Strange things happening with definite integration by substitution

There are two ways solving the definite integration by substitution. One is to solve the indefinite integration first, then use the evaluation theorem. Another is to use the substitution rule for definite integral. However, when I solved some problems, say calculating the following integral:$$\int_0^{2\pi}\frac{dx}{(2+\cos (x)) (3+\cos (x))},$$

the answer is 0 by the first method. But, the graph of the integrand implies that this is impossible. So, what is the problem?

• What is antiderivative you used? Commented Mar 15, 2015 at 7:01
• Are you speaking about $\int_0^{2\pi}\frac{dx}{(2+\cos (x)) (3+\cos (x))}$ ? Could you clarify your problem and expalin what you did ? Commented Mar 15, 2015 at 7:01
• I separate the integrand into two parts, i.e.1/(2+cosx)and 1/(3+cosx). And substitute cosx with (1-tan^2(x))/(1+tan^2(x)).
– Ivy
Commented Mar 15, 2015 at 7:55
• I think we would need to see more details of your work before we could say what is wrong with it. Commented Mar 15, 2015 at 10:13

Use the method similar to partial fractions, $$\int \frac{dx}{(2+\cos{x})(3+\cos{x})} =\int \left(\frac{1}{2+\cos{x}}-\frac{1}{3+\cos{x}}\right)dx.$$
we have $\cos{\frac{x}{2}}=\frac{1}{\sqrt{1+u^2}}$ and $\sin{\frac{x}{2}}=\frac{u}{\sqrt{1+u^2}}$. Then $\sin{x}=2\sin{\frac{x}{2}}\cos{\frac{x}{2}}=\frac{2u}{1+u^2}$ and $\cos{x}=\cos^2{\frac{x}{2}}-\sin^2{\frac{x}{2}}=\frac{1-u^2}{1+u^2}$.
In addition, $u=\tan{\frac{x}{2}}$ and $x=2\arctan{u}$ and $dx=\frac{2}{1+u^2}du$.
Therefore, $$\int \frac{dx}{(2+\cos{x})} =\int \frac{\frac{2}{1+u^2}}{2+\frac{1-u^2}{1+u^2}}du =\int \frac{2}{3+u^2}du =\frac{2\arctan{\frac{u}{\sqrt{3}}}}{\sqrt{3}}+C =\frac{2\arctan{\frac{\tan{\frac{x}{2}}}{\sqrt{3}}}}{\sqrt{3}}+C$$ Similarly, $$\int \frac{dx}{(3+\cos{x})} =\frac{\arctan{\frac{\tan{\frac{x}{2}}}{\sqrt{2}}}}{\sqrt{2}}+C$$
So $$\int_{0}^{2\pi} \frac{dx}{(2+\cos{x})(3+\cos{x})} =\left[\frac{2\arctan{\frac{\tan{\frac{x}{2}}}{\sqrt{3}}}}{\sqrt{3}} -\frac{\arctan{\frac{\tan{\frac{x}{2}}}{\sqrt{2}}}}{\sqrt{2}}\right]_{0}^{2\pi} =\left(\frac{2}{\sqrt{3}}-\frac{1}{\sqrt{2}}\right) \neq 0$$