I have to calculate
$$\int_{\frac{\pi}{4}}^{\frac{\pi}{3}} \frac{\tan(x)}{1+\tan(x)}\ dx$$
This is my attempt.
I decide to do it by sostituition, so:
$t=\tan(x) \Longrightarrow x=\arctan(t) \Longrightarrow dx=\frac{dt}{1+t^2}$.
Therefore:
$$\int_{\frac{\pi}{4}}^{\frac{\pi}{3}} \frac{\tan(x)}{1+\tan(x)}\ dx=\int_1^{\sqrt{3}} \frac{t}{(1+t)(1+t^2)}\ dt$$
Now I use the simple fracts to rewrite the integrand:
$$\frac{t}{(1+t)(1+t^2)}=\frac{A}{1+t}+\frac{Bt+C}{1+t^2}=\frac{A+At^2+Bt+C+Bt^2+Ct}{(1+t)(1+t^2)}=\frac{(A+B)t^2+(B+C)t+A+C}{(1+t)(1+t^2)}$$To have the equivalence, we need to set the following conditions:
$$\begin{cases}A+B=0 \\ B+C=1 \\ A+C=0\end{cases} \Longrightarrow \begin{cases}A=-1/2 \\ B=1/2 \\ C=1/2\end{cases}$$
So, we have that :
$$\frac{t}{(1+t)(1+t^2)}=\frac{-1}{2(1+t)}+\frac{t+1}{2(1+t^2)}$$
and then:
$$\int_1^{\sqrt{3}} \frac{t}{(1+t)(1+t^2)}\ dt=-\frac{1}{2}\int_{1}^{\sqrt{3}} \frac{1}{1+t}\ dt +\frac{1}{2}\int_{1}^{\sqrt{3}}\frac{1+t}{(1+t^2)}\ dt=$$$$=-\frac{1}{2}\Bigl[\ln(1+t)\Bigl]^\sqrt{3}_1+\frac{1}{2}\Bigl[\arctan(t)+\frac{1}{2}\ln\left(1+t^2\right)\Bigl]^{\sqrt{3}}_1=[...]$$
Is this correct? Is there a shorter way to do it?