How to integrate $\int{\frac{\sin ^{2}\theta }{\cos ^{5}\theta }d\theta }$?

$\int \dfrac{\sin^2\theta}{\cos^5\theta}\mathscr{d}\theta=\int \dfrac{1}{\cos^5\theta}\mathscr{d}\theta-\int \dfrac{1}{\cos^3\theta}\mathscr{d}\theta$
Let $I_n:=\int \cos^n\theta\mathscr{d}\theta$,
we have
$\begin{align*} I_n=\int \cos^{n-1}\theta\mathscr{d}\sin\theta&=\cos^{n-1}\theta\sin\theta-\int \sin\theta\mathscr{d}\cos^{n-1}\theta \\&=\cos^{n-1}\theta\sin\theta+(n-1)\int\cos^{n-2}\theta\sin^2\theta\mathscr{d}\theta \\&=\cos^{n-1}\theta\sin\theta+(n-1)(I_{n-2}-I_n) \end{align*}$
hence, $nI_n=(n-1)I_{n-2}+\cos^{n-1}\theta\sin\theta$.
Also, we have $I_{-1}=\int \sec\theta\mathscr{d}\theta=\ln |\sec\theta+\tan\theta|+C$.
So, $I_{-3}=\dfrac{\ln |\sec\theta+\tan\theta|+\sec^2\theta\sin\theta}{2}+C$ and $I_{-5}=\dfrac{3I_{-3}+\sec^4\theta\sin\theta}{4}$.
$\therefore \int \dfrac{\sin^2\theta}{\cos^5\theta}\mathscr{d}\theta=I_{-5}-I_{-3}=\dfrac{-\ln |\sec\theta+\tan\theta|-\sec^2\theta\sin\theta+2\sec^4\theta\sin\theta}{8}+C$