Integral with Weierstrass substituion, limits gone wrong I'm trying to evaluate the following integral with a Weierstrass substitution:
$$
\int_{\pi/3}^{4\pi/3} \frac{3}{13 + 6\sin x - 5\cos x} \text{d}x
$$
This comes out to about 0.55 when evaluated numerically. I thought it would be possible to rewrite the integral using the substitution $t = \tan\frac{x}{2}$ like so:
$$
\text{Upper limit: }\frac{4\pi}{3} \to \tan\frac{4\pi}{6} \to -\sqrt{3}
$$
$$
\text{Lower limit: }\frac{\pi}{3} \to \tan\frac{\pi}{6} \to \sqrt{3}/3
$$
$$
\int_{\sqrt{3}/3}^{-\sqrt{3}} \frac{3(1+t^2)}{2(3t+1)^2 + 6} \cdot \frac{2}{1 + t^2} \text{d}x
$$
However, evaluating this numerically now gives -1.26, so it's clear that this method is wrong. I am sure that
$$
\frac{3}{13 + 6\sin x - 5\cos x} = \frac{3(1+t^2)}{2(3t+1)^2 + 6}
$$
So something must have gone wrong changing the limits, but I've never come across this problem before. I thought the integral may be improper but plotting $\frac{3}{13 + 6\sin x - 5\cos x}$ on a graph shows it has no asymptotes or any other obvious problems in the range of integration.
Any help would be greatly appreciated :)

Take care of the discontinuity at $x=\pi$ with the half angle substitution $t=\tan\frac x2$
\begin{align}
&\int_{\pi/3}^{4\pi/3} \frac{3}{13 + 6\sin x - 5\cos x} dx
\overset{t=\tan\frac x2}=\bigg(\int_{\frac1{\sqrt3}}^\infty +\int_{-\infty}^{-\sqrt3}\bigg)
\frac3{4+6t+9t^2}dt
\end{align}
