I=∫tanxa2+b2tan2xdx
Put u=tanx⇒du=sec2xdx
∴I=∫u(u2+1)(a2+b2u2)du
Put s=u2⇒ds=2udu.
∴I=12∫1(s+1)(a2+b2s)ds.
=12∫(1s(a−b)(a+b)+(a−b)(a+b)−b2a2(a−b)(a+b)+b2s(a−b)(a+b))ds
=log((u2+1)(a−b)(a+b))2(a−b)(a+b)−log((a+b)(a−b)(a2+b2u2))2(a−b)(a+b)
=log((a2−b2)cos2x+a2+b2)2(a2−b2)