A continuous function over $\Bbb R$ has a primitive that is also continuous over $\Bbb R$.
However, it often happens with Mathematica and other CAS that the result is not continuous, especially with trigonometric integrals computed with the Weierstrass substitution. The result can't be correct because from a periodic integrand this substitution leads to a periodic primitive, while the primitive over $\Bbb R$ is not periodic in general.
For instance:
In[1]:= Integrate[3/(5 - 4 Cos[x]), x]
Out[1]= 2 ArcTan[3 Tan[x/2]]
My question: Is there a way in Mathematica (an option, a package...) to obtain a continuous primitive in this case?
A correct one could be:
$$x + 2 \arctan\left(\frac{\sin x}{2 - \cos x}\right)$$
There are publications about this:
- D. J. Jeffrey, "The Importance of Being Continuous"
- David J. Jeffrey, Albert D. Rich, "The evaluation of trigonometric integrals avoiding spurious discontinuities"
See also this related question on Math.SE.
I wonder if Mathematica has implementations of the methods mentioned in those articles.