<s>[INST] Solve $ay''+by+c=0$ using separation of variables How could be
$$ay''+by+c=0$$
(for constants $a,b,c$) solved using separation of variables?
I tried using the method on an easier equation, namely $ay''+by'+c=0$:
$$\begin{align}a\frac{d^2y}{dx^2}+b\frac{dy}{dx}+c&=0,\, u=\frac{dy}{dx}\\a\frac{du}{dx}+bu+c&=0\\ \frac{1}{a}\frac{dx}{du}&=-\frac{1}{bu+c}\\x&=-a\int \frac{du}{bu+c}=-a\left(\frac{\ln |bu+c|}{b}+C\right)\\-\frac{b}{a}(x+aC)&=\ln |bu+c|\\|bu+c|&=e^{-\frac{b}{a}(x+aC)}\\bu+c=b\frac{dy}{dx}+c&=C'e^{iC''}e^{-\frac{b}{a}(x+aC)},\, \color{red}{C'\ge 0,\, C''\in\mathbb{R}}\\y&=\frac{1}{b}\left(C_0\int e^{-\frac{b}{a}(x+aC)}\, dx-c\int dx\right)\\&=\frac{1}{b}\left(C_0\left(-\frac{ae^{-\frac{b}{a}(x+aC)}}{b}+C'''\right)-c(x+C'''')\right).\end{align}$$
When I tried to apply this method on $ay''+by+c=0$, I ran into problems, as the degrees of the derivatives differ by $2$, not $1$:
$$\begin{align}a\frac{d^2 y}{dx}+by+c&=0,\, \frac{dy}{dx}=u\\a\frac{du}{dx}+b\int u\, dx+c&=0\\ \frac{dx}{du}&=-\frac{a}{b\int u\, dx+c}\\x&=-a\int\frac{du}{b\int u\, dx+c}.\end{align}$$
I'm stuck here. The solution should be
$$y=Ce^{x\sqrt{\frac{b}{a}}}+C'e^{-x\sqrt{\frac{b}{a}}}-\frac{c}{b}.$$
 [/INST] $$ay''+by+c=0$$
Substitute $p=\dfrac {dy}{dx}=y'$ then you have:
$$y''=\dfrac {dy'}{dx}=\dfrac {dp}{dx}=\dfrac {dp}{dy}\dfrac {dy}{dx}=p'p$$
Where $p'=\dfrac {dp}{dy}$.
The differential equation becomes:
$$app'+by+c=0$$
This is now a first order DE that is separable:
$$a\int p\;dp =-\int (c+by) \; dy$$
$$ap^2=-2cy-by^2+C_1$$
$$\dfrac {dy}{dx}=\pm \sqrt  {\dfrac { -2cy-by^2+C_1}a}$$
Note that:
$$-by^2-2cy+C_1=-b(y^2+2\dfrac cby +\dfrac {c^2}{b^2})+K_1$$
$$=-b(y+\dfrac cb)^2+K_1$$
This last differential equation is also separable:
$$\int \dfrac {dy}{\sqrt {C-(y+\dfrac cb)^2}}=\pm \int \sqrt  {\dfrac {b}a}dx$$
And
$$(\arcsin x)'=\int \dfrac {dx}{\sqrt {1-x^2}}$$
</s>