A Definite Integral I Given the definite integral 
\begin{align}
\int_{0}^{\pi} \frac{1+\cot^{2}(t)}{\cot^{2}(t)} \, \ln\left( \frac{1+2\tan^{2}(t)}{1+\tan^{2}(t)} \right) \, dt = -2\pi
\end{align}
then what is the general value of the indefinite integral
\begin{align}
\int \frac{1+\cot^{2}(t)}{\cot^{2}(t)} \, \ln\left( \frac{1+2\tan^{2}(t)}{1+\tan^{2}(t)} \right) \, dt \,\,\, ?
\end{align}
 A: $$\begin{align}
\int \frac{1+\cot^{2}(t)}{\cot^{2}(t)} \, \ln\left( \frac{1+2\tan^{2}(t)}{1+\tan^{2}(t)} \right) \, dt 
&= \int\sec^2t\ln\left(1+\sin^2t\right) dt\\
&=\ln(1+\sin^2t)\int\sec^2tdt-\int\frac{2\sin t\cos t}{1+\sin^2t}\int\sec^2tdtdt\\
&=\ln(1+\sin^2t)\tan t-\int\frac{2\sin t\cos t\tan t}{1+\sin^2t}dt\\
&=\ln(1+\sin^2t)\tan t-2\int\left(1-\frac{1}{1+\sin^2t}\right)dt\\
&=\ln(1+\sin^2t)\tan t-2t+2\int\frac1{1+\sin^2t}dt
\end{align}$$
Now 
$$\begin{align}
\int\frac1{1+\sin^2t}dt
&=\int\frac{\sec^2tdt}{\sec^2t+\tan^2 t}\\
&\stackrel{u=\tan x}\equiv\int\frac{du}{2+u^2}\\
&=\frac1{\sqrt2}\arctan\frac{\tan x}{\sqrt2}+c
\end{align}$$
So 
$$
\int \frac{1+\cot^{2}(t)}{\cot^{2}(t)} \, \ln\left( \frac{1+2\tan^{2}(t)}{1+\tan^{2}(t)} \right) \, dt 
=\ln(1+\sin^2t)\tan t-2t+\sqrt2\arctan\left(\frac{\tan x}{\sqrt2}\right)+C$$
Also $$\left(
\ln(1+\sin^2t)\tan t-2t+\sqrt2\arctan\left(\frac{\tan x}{\sqrt2}\right)\right)_0^{\pi}
\\=-2(\pi-0)+\sqrt2\left(\arctan(0)-\arctan(0)\right)+\ln(1+0)\tan(\pi)-\ln(1+0)\tan(0)
\\=-2\pi$$
A: $$I=\int \frac{1+\cot^{2}(t)}{\cot^{2}(t)} \, \ln\left( \frac{1+2\tan^{2}(t)}{1+\tan^{2}(t)} \right) \, dt \,\,\, $$
$$=\int(1+\tan^2t)[\ln(1+2\tan^2t)-\ln(1+\tan^2t)]dt$$
Setting $\tan t=u,$
$$I=\int[\ln(1+2u^2)-\ln(1+u^2)]du$$
which should be addressed by Integration by Parts 
