Solve $y''-4y'+3y=\frac{2x+1}{x^2}e^x$ I want to solve the linear second order nonhomgenous ODE $y''-4y'+3y=\frac{2x+1}{x^2}e^x$
I found the complementary homogenous solutions: $y_1=e^{3x}$ and $y_2=e^{x}$, the wronskian is $|W|=-2e^{4x}$
So as far as I know, we have 2 options to find a particular solution. We can either calculate this monster integral:
$$y_p=e^{3x} \int \frac{e^{2x} \frac{2x+1}{x^2}}{2e^{4x}}dx-e^{x}\int \frac{e^{4x}\frac{2x+1}{x^2}}{2e^{4x}}dx$$
Or we can use the undetermined coefficients method, but for that we need to think of "what form" will our solution be.
$\frac{2x+1}{x^2}e^x$ is not a simple function, it's not as easy as just a polynomial or just an exponential, what do we do in this case?
 A: Factoring your differential expression, your differential equation can be written
$$
(D^2-4D+3)y=(D-3)(D-1)y=\frac{2x+1}{x^2}e^x.
$$
Now leg $z=(D-1)y=y'-y$. Then, we want to solve
$$
(D-3)z=z'-3z=\frac{2x+1}{x^2}e^x.
$$
Multiplying with the integrating factor $e^{-3x}$ this can be written
$$
D(e^{-3x}z)=\frac{2x+1}{x^2}e^{-2x}.
$$
Thus (here we are "lucky"!)
$$
e^{-3x}z=\int \frac{2x+1}{x^2}e^{-2x}\,dx = -\frac{e^{-2x}}{x}+C,
$$
where $C$ is an arbitrary constant. Hence
$$
z=-\frac{e^x}{x}+Ce^{3x}.
$$
Next, we want to solve
$$
(D-1)y=y'-y=z=-\frac{e^x}{x}+Ce^{3x}.
$$
Multiplying with the integrating factor $e^{-x}$, we have
$$
D(e^{-x}y)=-\frac{1}{x}+Ce^{2x}.
$$
Integrating, we get (here $C_1=C/2$ and $C_2$ is arbitrary)
$$
e^{-x}y=-\ln |x|+C_1e^{2x}+C_2.
$$
Thus
$$
y(x)=-\ln |x|e^x+C_1e^{3x}+C_2e^x.
$$
Finally a note: We are really lucky here. Changing just some coefficient slightly, and we don't get an elementary solution to this differential equation.
A: Hint: can you find $A,B,C$ such that
$$ A e^x + \frac{B}{x} e^x + C e^x \log x$$
is a solution of the ODE?
A: i want to try this out. one way of finding a particular solution is to integrate 
$\begin{align}
\int_1^xe^{-x}\left(y^{\prime \prime}-4y^\prime + 3y  \right) dx &=
y^\prime e^{-x}|_1^x + \int_0^x y^\prime e^{-x}\, dx 
+ \int_1^xe^{-x}\left(-4y^\prime + 3y  \right) dx\\
&=y^\prime e^{-x} - \frac{y^\prime(1)}{ e}-3\int_1^x (y^\prime e^{-x}- ye^{-x} ) dx\\
&= y^\prime e^{-x} - \frac{y^\prime(1)}{ e}-3ye^{-x}|_1^x\\
&= y^\prime e^{-x} -3ye^{-x} + \frac{3y(1)-y^\prime(1)}{e}
\end{align}$
doing the integral on the right hand side 
$\int_1^x \frac{2x+1}{x^2}\, dx = 2\ln x  -\frac{1}{x} + 1$ so now we need to solve $$  y^\prime e^{-x} -3ye^{-x} = 2\ln x  -\frac{1}{x} + 1 - \frac{3y(1)-y^\prime(1)}{e} $$ which can be transformed into 
$$y =y(1) e^{3x} + e^{3x} \left(\int_1^x \left(2\ln x  -\frac{1}{x} + 1 - \frac{3y(1)-y^\prime(1)}{e} \right) e^{-2x}\, dx  \right)$$
ignoring the homogeneous solutions $e^x, e^{3x}, $ we will compute 
$$\int_1^x(2\ln x - \frac{1}{x})e^{-2x} \, dx = -e^{-2x}\ln x|_1^x + \int_1^x e^{-2x}\frac{1}{x} \, dx - \int_1^x e^{-2x}\frac{1}{x} \, dx  = -e^{-2x}\ln x $$
finally, after all this, it is  $$y = -e^x \ln x \text{ is a particular solution of   }  y''-4y'+3y=\frac{2x+1}{x^2}e^x$$
