Solving the following (fairly simple) differential equation... I need to solve the following differential equation: 
$$y'\cos^2x+y=\tan(x)$$
I have tried to solve it using the integrating factor $e^{\int (1/\cos^2x) \mathrm{d}x}$, but things got messed up. How am I to solve it? Should I try a different path? 
Thank you!

First, solve the homogeneous equation $Y'\cos^2(x)+Y=0$
This leads to $Y=c*e^{\tan(x)}$
Then use the method of variation of the constant : let $y=f(x)*e^{\tan(x)}$
Plug this function into $y'\cos^2(x)+y=\tan(x)$ 
After simplification, determine $f(x)$ by a simple integration.
