Let's consider a problem, which is to find the indefinite integral $$I(x):=\displaystyle \int \frac{1}{2+\cos 2x}dx.$$ Since the integrand $f(x):=\dfrac{1}{2+\cos 2x}$ is continuous over $(-\infty,+\infty)$, hence $I(x)$ exists necessarily, accoring to the following theorem:
every function continuous over the given interval $I$ has its anti-derivative,namely indefinite integral over $I$.
Ok, now let's find it. The steps may be not so complicated. \begin{align*} I(x)&=\int \frac{1}{2+\cos 2x}dx\\ &=\frac{1}{2}\int\frac{1}{2+\cos 2x}d(2x)~~~&\textit{$2x=u$}\\ &=\frac{1}{2}\int\frac{1}{2+\cos u}d(u)\\ &=\frac{1}{2}\int\frac{\sec^2(u/2)}{\tan^2(u/2)+3}du~~~&\textit{$(\tan(u/2))/\sqrt{3}=v$}\\ &=\frac{1}{\sqrt{3}}\int\frac{1}{v^2+1}dv\\ &=\frac{1}{\sqrt{3}}\arctan v+C\\ &=\frac{1}{\sqrt{3}}\arctan \frac{\tan x}{\sqrt{3}}+C. \end{align*} The result comes out! Is it true? The WA outputs the same result! The problem seems to be done like this. But wait,wait,please scrutinize the form of the obtained indefinite integral. It is not continuous at every $x=2k\pi\pm \dfrac{\pi}{2}(k=0,\pm 1,\pm 2,\cdots).$ But, we know that
Every indefinite integral is necessarily continuous at the corresponding inteval.
What's $\displaystyle \int \frac{1}{2+\cos 2x}dx$ on earth?