Substitution for Differential equations Dear StackExchange users,
I have a little question ... I just don't have a clue how that works
I have the following differential equation
$$\frac{dy}{dx}=xy^2-2\frac{y}{x}-\frac{1}{x^3}$$
My book says that one can substitute $(r,s) = (x^2y,\ln{|x|})$ to get
$$\frac{ds}{dr}=\frac{1}{r^2-1}$$
The right-hand side of the ODE is not my problem. The right-hand side reduces to
$$\exp{(-3s)}(r^2-2r-1)$$
I just don't know how to replace $dy/dx$ by an expression depending on $ds/dr$. I would be very thankful if someone could show me how that works step by step. 
 A: You have $$\frac{dr}{dx}=2xy+x^2\frac{dy}{dx}$$ and $$\frac{ds}{dx}=\frac 1x$$
Therefore, $$\frac{dr}{ds}=2x^2y+x^3\frac{dy}{dx}=2r+e^{3s}\frac{dy}{dx}$$
So now you can make the substitution.
A: I am adding an alternative method that might be useful to other users.
First we note that $y=y(r,s)$ and $x=x(r,s)$, hence
$$\dfrac{dy}{dx}=\dfrac{dy(r,s)}{dx(r,s)}.$$
Now, we apply the total derivative for $dy(r,s)$ and $dx(r,s)$.
$$\dfrac{dy(r,s)}{dx(r,s)}=\dfrac{\dfrac{\partial y}{\partial r}dr+\dfrac{\partial y}{\partial s}ds}{\dfrac{\partial x}{\partial r}dr+\dfrac{\partial x}{\partial s}ds}=\dfrac{\dfrac{\partial y}{\partial r}+\dfrac{\partial y}{\partial s}\dfrac{ds}{dr}}{\dfrac{\partial x}{\partial r}+\dfrac{\partial x}{\partial s}\dfrac{ds}{dr}}.$$
Now, we solve the substitution equations for $x(r,s)$ and $y(r,s)$ to obtain $x(r,s) =e^s$ and $y(r,s)=re^{-2s}$. Using this in 
$$\dfrac{\dfrac{\partial y}{\partial r}+\dfrac{\partial y}{\partial s}\dfrac{ds}{dr}}{\dfrac{\partial x}{\partial r}+\dfrac{\partial x}{\partial s}\dfrac{ds}{dr}}=\dfrac{e^{-2s}+(-2re^{-2s})\dfrac{ds}{dr}}{0+e^s\dfrac{ds}{dr}}=e^{-3s}\left[\dfrac{dr}{ds}-2r\right]$$
Now, we use the right side of the given ODE and substitute $x(r,s)$ and $y(r,s)$ to obtain:
$$e^{-3s}\left[\dfrac{dr}{ds}-2r\right]=e^sr^2e^{-4s}-2\frac{re^{-2s}}{e^{s}}-\frac{1}{e^{3s}} \implies \dfrac{dr}{ds}-2r=r^2-2r-1.$$
Hence, the ODE becomes 
$$\dfrac{dr}{ds}=r^2-1 \qquad \text{or} \qquad \frac{ds}{dr}=\frac{1}{r^2-1}.$$
