Riemann integral on trigonometric functions I have to calculate Riemann integral of function $g:[0;\pi/4]\rightarrow\mathbb{R}$ (on interval $[0;\pi/4]$) given as $g(x)=\frac{\tan(x)}{(\cos(x)^2-4)}$. Function $g$ is continous on interval $[0;\pi/4]$ so it is enough to calculate $\int_0^{\frac{\pi}{4}}{\frac{\tan(x)}{(\cos(x)^2-4)}}$. How to do that?
 A: Hint: let $t=\tan(\frac{x}{2})$, then
$$\sin(x) = \frac{2t}{1+t^2}, \cos(x) = \frac{1-t^2}{1+t^2}$$
and
$$x=2\arctan(t) \implies dx = \frac{2 dt}{1+t^2}$$
so
$$\begin{aligned}
&\int \frac{\tan(x)}{(\cos(x)^2-4)} dx = \int \frac{\sin(x)}{\cos(x)(\cos(x)-2)(\cos(x)+2)} dx\\
&= \int \frac{2t}{1+t^2} \cdot \frac{1+t^2}{1-t^2} \cdot \frac{1}{\frac{1-t^2}{1+t^2} - 2} \cdot \frac{1}{\frac{1-t^2}{1+t^2} + 2} \cdot \frac{2 dt}{1+t^2}\\
&\ldots
\end{aligned}$$
A: substitue $u = cosx$, then you will have $du = -sinx dx$. Then you will have 1 in numerator and some polynomial in denominator, which can be fractionized as $u * (u - 2) * (u + 2)$. Then your going to separate it to partial fractions. Rest is simple integration... Don't forget to change integration limits.
A: By substituting $x=\arctan(t)$ we have:
$$ I=\int_{0}^{\pi/4}\frac{\tan(x)}{\cos^2(x)-4}=\int_{0}^{1}\frac{t\,dt}{(t^2+1)\left(\frac{1}{1+t^2}-4\right)}=-\int_{0}^{1}\frac{t\,dt}{3+4t^2}$$
so:
$$ I = -\frac{1}{8}\int_{0}^{1}\frac{8t\,dt}{3+4t^2} = -\frac{1}{8}\left.\log(3+4t^2)\right|_{0}^{1} = \color{red}{\frac{1}{8}\,\log\frac{3}{7}}.$$
