How to solve the differential equation $y' + \sec(x)*y = \tan(x)$ I am really struggling to solve the differential equation: $y' + \sec(x)y = \tan(x)$. If someone could point me in the right direction or give me a step by step plan it would be much appreciated!
So far I have tried taking the common factor to be $\exp(\int(\sec(x))$  (which simplifies to $\tan(x)+\sec(x)+c$ if I am not mistaken) however I end up with an equation which is beyond my integration abilities because it has both $X$ and $Y$ in it. I'm not sure if it is a case of trig identities or imaginary numbers which are letting me down.
Thanks in advance!!
 A: This is in the form of a Linear Differential Equation
and here the integrating factor would be $e^{\int(\sec(x))}$ so that you will get $$\begin{align}
(\tan(x)+\sec(x))\frac{dy}{dx}+(\tan(x)+\sec(x))y\sec(x) = &\, \tan^2(x)+\sec(x)\tan(x) \\
((\tan(x)+\sec(x))y)' = & \\
\end{align}$$
So integrating on both sides you have, $$(\tan(x)+\sec(x))y=\tan(x)+\sec(x)-x+C$$ $$y=\frac{\tan(x)+\sec(x)-x+C}{\tan(x)+\sec(x)}.$$
I have just outlined what you need to do here, you can go to the hyperlink given to know more about linear differential equations. Hope it helps.
EXTRA EDITS:
Links to the integrals: integrating factor, and the integral of the right side. For both links, press the Go!button next to the formula.
A: As you have noted, the integrating factor is
$$\exp\left(\int\sec x\,dx\right)
    = \exp\left(-\ln(\cos(x/2)-\sin(x/2)) + \ln(\cos(x/2)+\sin(x/2))\right)
    = \frac{\cos(x/2)+\sin(x/2)}{\cos(x/2)-\sin(x/2)}
    = \frac{\cos x}{(\cos(x/2)-\sin(x/2))^2}.$$
Multiplying both sides by the integrating factor gives
\begin{align*}
  \frac{d}{dx}\left(y\frac{\cos x}{(\cos(x/2)-\sin(x/2))^2}\right) 
    &= \tan x\cdot\frac{\cos x}{(\cos(x/2)-\sin(x/2))^2} \\
    &= \frac{\sin x}{(\cos(x/2)-\sin(x/2))^2} \\
    &= \frac{\sin x}{1 - 2\sin(x/2)\cos(x/2)} \\
    &= \frac{\sin x}{1-\sin x}.
\end{align*}
Now just integrate both sides.
