Ta có $\tan (x+\dfrac{\pi}{4})=\dfrac{1+\tan x}{1-\tan x}$
$I=\int \dfrac{\tan^2 x +\tan x}{1-\tan x}dx$ đặt $\tan x = t \Rightarrow \dfrac{dx}{\cos^2 x}=dt$ hay $(1+\tan^2 x)dx = dt$
$\Rightarrow dx=\dfrac{1}{1+t^2}dt$
$I=\int \dfrac{t^2+t}{1-t} .\dfrac{1}{t^2+1}dt =-\int \bigg (\dfrac{1}{t^2+1} +\dfrac{1}{t-1} \bigg )dt$ dễ rồi nhé