Solve the differential equation $x^5\frac{d^2y}{dx^2}+3x^3\frac{dy}{dx}+(3-6x)x^2y=x^4+2x-5$ Solve the differential equation $$x^5\frac{d^2y}{dx^2}+3x^3\frac{dy}{dx}+(3-6x)x^2y=x^4+2x-5$$
In the solution of the above the question the author is trying to convert it into an exact differential equation by multiplying $x^m$ and comparing the given equation to $$P_{0}y''+P_{1}y'+P_{2}y=\phi(x)$$
To make it exact it tried to $P_{2}-P_{1}'+P_{0}''=0$ how is he getting to this equation ? 
Also further on using this equation a value of $m$ was derived and substituted , then a first integral was made. 
My question is what exactly is first integral and how is it relevant in solving ordinary differential equation . If someone can guide me to a good source or link I would be thankful 
Also the method shown above is it a standard method of solving ODE ? if yes could you also please let me know the name / link of a source from where I can read this method. 
 A: The idea is to write the equation as
$$ (Ay' + By)' = \phi $$
where $A,B$ are functions of $x$, so the problem is reduced to a first-order equation upon integration.
Expanding the derivative, we get
$$ (Ay' + By)' = Ay'' + (A'+B)y' + B'y = P_0 y'' + P_1 y' + P_2y $$
Comparing coefficients
\begin{align} P_0 &= A \\ P_1 &= A' + B \\ P_2 &= B' \end{align}
Therefore, it must be true that
$$ P_2 - P_1' + P_0'' = B' - (A'+B)' + A'' = 0 $$
Obviously, only a very specific set of coefficient functions $\{P_0,P_1,P_2\}$ will satisfy this. That's a question I don't have the answer to.
A: Hint:
$x^5\dfrac{d^2y}{dx^2}+3x^3\dfrac{dy}{dx}+(3-6x)x^2y=x^4+2x-5$
$x^3\dfrac{d^2y}{dx^2}+3x\dfrac{dy}{dx}-(6x-3)y=x^2+\dfrac{2}{x}-\dfrac{5}{x^2}$
Let $y=x^nu$ ,
Then $\dfrac{dy}{dx}=x^n\dfrac{du}{dx}+nx^{n-1}u$
$\dfrac{d^2y}{dx^2}=x^n\dfrac{d^2u}{dx^2}+nx^{n-1}\dfrac{du}{dx}+nx^{n-1}\dfrac{du}{dx}+n(n-1)x^{n-2}u=x^n\dfrac{d^2u}{dx^2}+2nx^{n-1}\dfrac{du}{dx}+n(n-1)x^{n-2}u$
$\therefore x^3\left(x^n\dfrac{d^2u}{dx^2}+2nx^{n-1}\dfrac{du}{dx}+n(n-1)x^{n-2}u\right)+3x\left(x^n\dfrac{du}{dx}+nx^{n-1}u\right)-(6x-3)x^nu=x^2+\dfrac{2}{x}-\dfrac{5}{x^2}$
$x^{n+3}\dfrac{d^2u}{dx^2}+2nx^{n+2}\dfrac{du}{dx}+n(n-1)x^{n+1}u+3x^{n+1}\dfrac{du}{dx}+3nx^nu-(6x-3)x^nu=x^2+\dfrac{2}{x}-\dfrac{5}{x^2}$
$x^{n+3}\dfrac{d^2u}{dx^2}+x^{n+1}(2nx+3)\dfrac{du}{dx}+x^n((n(n-1)-6)x+3n+3)u=x^2+\dfrac{2}{x}-\dfrac{5}{x^2}$
Choose $n=3$ , the ODE becomes
$x^6\dfrac{d^2u}{dx^2}+x^4(6x+3)\dfrac{du}{dx}+12x^3u=x^2+\dfrac{2}{x}-\dfrac{5}{x^2}$
$x^3\dfrac{d^2u}{dx^2}+x(6x+3)\dfrac{du}{dx}+12u=\dfrac{1}{x}+\dfrac{2}{x^4}-\dfrac{5}{x^5}$
Let $t=\dfrac{1}{x}$ ,
Then $\dfrac{du}{dx}=\dfrac{du}{dt}\dfrac{dt}{dx}=-\dfrac{1}{x^2}\dfrac{du}{dt}=-t^2\dfrac{du}{dt}$
$\dfrac{d^2u}{dx^2}=\dfrac{d}{dx}\left(-t^2\dfrac{du}{dt}\right)=\dfrac{d}{dt}\left(-t^2\dfrac{du}{dt}\right)\dfrac{dt}{dx}=\left(-t^2\dfrac{d^2u}{dt^2}-2t\dfrac{du}{dt}\right)\left(-\dfrac{1}{x^2}\right)=\left(-t^2\dfrac{d^2u}{dt^2}-2t\dfrac{du}{dt}\right)(-t^2)=t^4\dfrac{d^2u}{dt^2}+2t^3\dfrac{du}{dt}$
$\therefore\dfrac{1}{t^3}\left(t^4\dfrac{d^2u}{dt^2}+2t^3\dfrac{du}{dt}\right)-\dfrac{1}{t}\left(\dfrac{6}{t}+3\right)t^2\dfrac{du}{dt}+12u=t+2t^4-5t^5$
$t\dfrac{d^2u}{dt^2}-(3t+4)\dfrac{du}{dt}+12u=t+2t^4-5t^5$
For $t\dfrac{d^2u}{dt^2}-(3t+4)\dfrac{du}{dt}+12u=0$ ,
It has the trivial solution $u=e^{3t}$ .
Then solve it by reduction of order.
