Second Order ODE/y'' - f(x) y' + (f(x) - 1) y = 0

Theorem
The second order ODE:
 * $(1): \quad y'' - f \left({x}\right) y' + \left({f \left({x}\right) - 1}\right) y = 0$

has the solution:
 * $\displaystyle y = C_1 e^x + C_2 e^x \int e^{-2 x + \int f \left({x}\right) \, \mathrm d x} \, \mathrm d x$

Proof
Note that:

Note that:
 * $1 - f \left({x}\right) + \left({f \left({x}\right) - 1}\right) = 0$

so if $y'' = y' = y$ we find that $(1)$ is satisfied.

So:

and so:
 * $y_1 = e^x$

is a particular solution of $(1)$.

$(1)$ is in the form:
 * $y'' + P \left({x}\right) y' + Q \left({x}\right) y = 0$

where:
 * $P \left({x}\right) = - f \left({x}\right)$

From Particular Solution to Homogeneous Linear Second Order ODE gives rise to Another:
 * $y_2 \left({x}\right) = v \left({x}\right) y_1 \left({x}\right)$

where:
 * $\displaystyle v = \int \dfrac 1 { {y_1}^2} e^{-\int P \, \mathrm d x} \, \mathrm d x$

is also a particular solution of $(1)$.

We have that:

Hence:

and so:

From Two Linearly Independent Solutions of Homogeneous Linear Second Order ODE generate General Solution:


 * $\displaystyle y = C_1 e^x + C_2 e^x \int e^{-2 x + \int f \left({x}\right) \, \mathrm d x} \, \mathrm d x$