Q:

ODE in form $(f(x).y)'' = g(x)$

I am trying to solve the following linear second order ODE:
(1) $\cos(x)y'' - 2\sin(x)y' - \cos(x)y = e^x$
And I noticed this can be written as:
(2) $\frac{d^2}{dx^2}y\cos(x) = e^x$
And while I feel this simplification is not a coincidence and should be used in this problem I don't know how to use formula (2) to find homogeneous and particular solutions.
Is this simplification useful for this problem or am I grasping at straws?

A:

There's no need to find homogeneous/particular solutions because you have identified that this is an exact equation. Integrating both sides with respect to $x$ twice gives
$$\cos{(x)}y=e^x+C_1x+C_2$$
$$\therefore y=\sec{(x)}(e^x+C_1x+C_2)$$

