I can't figure out the last step of the following question:
Show that the general solution of the differential equation: $dy/dx + y\tan x=1$ is given by: $y\sec x=\ln(\sec x + \tan x) + C$
This is what I've worked out so far:
To make things easier let $u(x)=\exp(\int\! \tan(x)\,\mathrm dx)=\sec(x)$
Multyply both sides by $u(x): \sec(x)\frac {dy(x)} {dx} + {\sec(x)}{\tan(x)}y(x)=\sec(x)$
Then substitute $\sec(x)\tan(x)= \frac {d\sec(x)} {dx}$
$\sec(x) \dfrac {dy(x)}{dx}+ \dfrac{d \sec(x)} {dx}y(x)= \sec(x)$
Using the reverse product rule of the LHS:
$\displaystyle\frac d {dx} (\sec(x)y(x))dx= \int \sec(x)\,dx$
then integrating both sides with respect to x $\int \frac d {dx} (\sec(x)y(x))dx= \int \sec(x)dx$
Therefore: $\sec(x)y= -\log(\cos(\tfrac x 2)- \sin(\tfrac x 2))+\log(\cos(\tfrac x 2) + \sin(\tfrac x 2)) + C$
Where do I go from here to find the solution (given in the question)? Thanks in advance!