How substitution is used in second order ODE? I am trying to determine how the equation was simplified which was shown (not completely) in textbook on ordinary differential equations.
The following equation,
\begin{equation}
\frac{d^2 Y}{d x^2} + Y(aY^{2} + b)^{-2}\frac{dY}{dx}+Y=0
 \label{1}
\end{equation}
can be simplified by assuming that
\begin{equation}
w=\frac{dY}{dx}
 \label{2}
\end{equation}
and 
\begin{equation}
z=-\frac{1}{2}Y^{2}
 \label{3}
\end{equation}
then the equation simplifies to Abel equation form which is 
\begin{equation}
\frac{dw}{dz}w + (-2az + b)^{-2}w+1=0
 \label{4}
\end{equation}
Here is my attempt
\begin{equation}
\frac{d^2 Y}{d x^2} + Y(aY^{2} + b)^{-2}\frac{dY}{dx}+Y=0
 \label{}
\end{equation}
\begin{equation}
\frac{d^2 Y}{d x^2}\frac{1}{Y} + (aY^{2} + b)^{-2}\frac{dY}{dx}+1=0
 \label{}
\end{equation}
\begin{equation}
\frac{d^2 Y}{d x^2}\frac{1}{Y} + (aY^{2} + b)^{-2}w+1=0
 \label{}
\end{equation}
\begin{equation}
\frac{d^2 Y}{d x^2}\frac{1}{Y} + (-2az + b)^{-2}w+1=0
 \label{}
\end{equation}
I am stuck with second derivative of Y and convert it into first derivative w with respect to z

Let $w=\dfrac{dY}{dx}$ ,
Then $\dfrac{d^2Y}{dx^2}=\dfrac{dw}{dx}=\dfrac{dw}{dY}\dfrac{dY}{dx}=w\dfrac{dw}{dY}$
$\therefore w\dfrac{dw}{dY}+Y(aY^2+b)^{-2}w+Y=0$
$w\dfrac{dw}{dY}=-\dfrac{Yw}{(aY^2+b)^2}-Y$
Let $z=-\dfrac{Y^2}{2}$ ,
Then $\dfrac{dw}{dY}=\dfrac{dw}{dz}\dfrac{dz}{dY}=-Y\dfrac{dw}{dz}$
$\therefore-Yw\dfrac{dw}{dz}=-\dfrac{Yw}{(aY^2+b)^2}-Y$
$w\dfrac{dw}{dz}=\dfrac{w}{(-2az+b)^2}+1$
$w\dfrac{dw}{dz}=\dfrac{w}{(2az-b)^2}+1$
Let $s=-\dfrac{1}{2a(2az-b)}$ ,
Then $\dfrac{dw}{dz}=\dfrac{dw}{ds}\dfrac{ds}{dz}=\dfrac{1}{(2az-b)^2}\dfrac{dw}{ds}=4a^2s^2\dfrac{dw}{ds}$
$\therefore4a^2s^2w\dfrac{dw}{ds}=4a^2s^2w+1$
$w\dfrac{dw}{ds}=w+\dfrac{1}{4a^2s^2}$
And luckily we can find its general solution in http://science.fire.ustc.edu.cn/download/download1/book%5Cmathematics%5CHandbook%20of%20Exact%20Solutions%20for%20Ordinary%20Differential%20EquationsSecond%20Edition%5Cc2972_fm.pdf#page=136.
