Final step in solving differential equation 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!
 A: You have a slightly unusual but essentially correct version of an integral of $\sec x$. There is an issue of missing absolute value signs, which are also missing in the problem's version, which should have been $\log(|\sec x+\tan x|$).
To see it is (apart from negativity issues) the same as the standard one used in the problem, we show that
$$\frac{\cos(x/2)+\sin(x/2)}{\cos(x/2)-\sin(x/2)}=\sec x+\tan x.$$
To see that this is enough, note that $\log a-\log b=\log(a/b)$. 
Multiply top and bottom by $\cos(x/2)+\sin(x/2)$.
At the bottom we get $\cos^2(x/2)-\sin^2(x/2)$, which by a double angle formula is equal to $\cos x$. On top we get $\cos^2(x/2)+\sin^2(x/2)+2\cos(x/2)\sin(x/2)$, which is $1+\sin x$.  
So we end up with $\frac{1+\sin x}{\cos x}$, which is $\sec x+\tan x$.
A: Since they're handing you a solution,
$$
y = \frac{\ln|\sec x+\tan x| + C}{\sec x} = (\cos x) \ln|\sec x+\tan x| + C\cos x,
$$
you can diffentiate, finding $dy/dx$, and plug it into the equation in place of $y$, and see if the two sides are equal.
In that way, you verify that it's a solution.  The next question is whether it's general, i.e. there are no other solutions.  That might follow from a theorem stated in a section of a textbook that you recently read.
