Recently, a question I asked had the differential equation $y''=xyy'$.
A trick to solving this quickly is to notice that scaling $y$ by $a$ and $x$ by $b$ shows that $a=1/b^2$ is the condition that leaves the equation unchanged. An ansatz of $y=\alpha/x^2$ is then proposed and one can easily solve for $\alpha$.
Is this generally true? Given an ODE of the form $f\left(y^{(n)}(x),y^{(n-1)}(x)...y'(x), y(x), x\right)=0$ and this is invariant under the transformation $y\rightarrow ay$ and $x\rightarrow bx$, can I
a) Always find a relationship between $a$ and $b$
b) If a) is true or I am able in a particular case to find a relationship between $a$ and $b$, can I then use an ansatz that relates $y$ and $x$ in the same way as $a$ and $b$?
Feel free to add proofs or counterexamples to illustrate.
Note that $x^n y^{(n)}/y$ is invariant under $y \to a y$ and $x \to b x$ for all $a$ and $b$. Thus for an equation constructed from these terms and constants there is no relationship between $a$ and $b$.
EDIT:
In part (b), you also sometimes have to include logarithmic factors. For example, $$x y' - x^2 y'' - y = 2 x$$ is invariant under $y \to a y, x \to b x$ for $a=b$. Your ansatz would lead to $y = x$, but this is not a solution. Instead, the solutions are $y = x \ln(x)^2 + c_1 x + c_2 x \ln(x)$.