Question on reduction of order for linear ODEs If the characteristic equation for a differential equation can be written as $(s-r_1)(s-r_2)$, the substition $z=y'-r_1y$ yields an equation of the form $z'-r_2z=f(x)$.
For example, if our equation is
$y''-3y'+2y=e^x$,
the substitution
$z=y'-2y$
simplifies to
$y''-2y'-(y'-2y)=z'-z=e^x$
At this point, integrating factors can be used to solve for $z$, then substituting back will yield a solution for $y$.  My first question is why does it work like this?
My second question is if there's a way to find a substitution for a general second order linear ODE
$y''+p(x)y'+q(x)y=f(x)$
that will similarly reduce the problem to a first order linear ODE which can then be solved by integrating factors?
 A: Consider the following:
$$ \begin{align}
e^{-P}\frac{d}{dx} e^{P-Q} \frac{d}{dx} e^Q y & = e^{-P} \frac{d}{dx} e^P (y' + yQ') \\
&= P'(y' + y Q') + (y'' + y' Q' + y Q'') \\
&= y'' + y' (P' + Q') + y (P'Q' + Q'') 
\end{align} $$
which is the reverse of the usual integrating factors procedure. I hope you accept that you can solve $e^{-P}\frac{d}{dx} e^{P-Q} \frac{d}{dx} e^Q y = f$ by algebraic manipulations and repeated integration (the $\frac{d}{dx}$ applies, by convention, to all the things after it). 
In the constant coefficient case, if the characteristic equation factors, one can solve for $P$ and $Q$ being linear functions (so $Q'' = 0$). In the variable coefficient case, you end up trying to solve (now writing $u = P'$ and $v = Q'$)
$$ u + v = p \qquad v' = q - uv $$
which can be transformed to solving the first order nonlinear ODE
$$ v' = q - pv + v^2 $$
whose solution may or may not be forthcoming. If you can find an explicit solution to the above ODE, then you can solve for $u,v$ in terms of $p,q,x$ and then integrate to get $P,Q$ in terms of $p,q,x$ and so on and so forth. Note that if $p$ and $q$ are constants, and the polynomial in the right hand side of the above equation has a root, then setting $v$ to be constant equal to that root is a solution of the nonlinear ODE. 
A: First question. Let $D$ be operator thta takes a finction $y$ into its derivative $y'$. The general second order linear equation with constant coefficients can be written as
$$
(D^2+P\,D+Q)y=f(x),\quad P,Q\in\mathbb{R}.
$$
If its characteristic equation is $(s-r_1)(s-r_2)$, then the equation can be factorized as
$$
(D-r_2)(D-r_1)y=f.
$$
The sustitution $z=y'-r_1=(D-r_1)y$ leads to $(D-r_2)z=f$.
Second question. In general, you cannot expect to find easely a factorization of the form
$$
D^2+P(x)\,D+Q(x)=(D-r_2(x))(D-r_1(x)).
$$
There is a procedure called reduction of order to solve a homogeneous linear equation
$$
y''+P\,y'+Q=0.
$$
If you know a solution $y_1$, you can find a second one, linearly independent, with the change $y=y_1\,v$.
