# Solve differential equation

How can we solve (if a closed form expression for f(x) can be found) the following first-order linear differential equation?

$$f'(x)=f(x)\cdot (\cos x+\tan x)$$

I have found that one function which validates this equation is: $$f(x)=\frac{e^{\sin x}}{\cos x}$$

HINT Separation of variables yields $$\int \frac{f'(x)dx}{f(x)} = \int (\cos x + \tan x) dx$$ and LHS integrates to $\ln f(x) + C$.
• So, RHS integrates to $\sin x + \ln {(\sec x)}$, ignoring constants because we already have $C$. Finally, we have $$f(x)=C_1 \cdot \frac{e^{\sin x}}{\cos x}$$ – Jason Jul 31 '15 at 16:01
• i think you get $\sin x + \ln |\sec x|$, and must carry the absolute value unless you restrict yourself to the interval where $\cos x \ge 0$... – gt6989b Jul 31 '15 at 16:03
• Yes, you are right! So, RHS integrates to $\sin x + \ln {\left| \sec x \right|}$, ignoring constants because we already have $C$. Finally, we have: $$f(x)=C_1 \cdot \frac{e^{\sin x}}{\left| \cos x \right|}$$ – Jason Jul 31 '15 at 16:07