Step 1: Simplify the denominator.
Using $\cos2x=\cos^2x-\sin^2x$ and $\sin2x=2\sin x\cos x$, the denominator is
\[ (\cos^2x-\sin^2x)+2\sin x\cos x+2\sin^2x=\cos^2x+\sin^2x+2\sin x\cos x. \]
Step 2: Recognise the perfect square.
This equals $1+2\sin x\cos x=(\sin x+\cos x)^2$.
Step 3: Convert to tangent.
Multiply top and bottom by $\sec^2x$. The integral becomes
\[ \int\frac{\sec^2x}{\sec^2x+2\tan x}\,dx. \]
Step 4: Complete the square in $\tan x$.
Since $\sec^2x=1+\tan^2x$, the denominator is $1+\tan^2x+2\tan x=(1+\tan x)^2$, so
\[ I=\int\frac{\sec^2x}{(1+\tan x)^2}\,dx. \]
Step 5: Substitute.
Let $u=1+\tan x$, so $du=\sec^2x\,dx$:
\[ I=\int u^{-2}\,du=-\frac{1}{u}+c. \]
Step 6: Back-substitute.
\[ I=-\frac{1}{1+\tan x}+c. \]
\[ \boxed{-\dfrac{1}{1+\tan x}+c} \]