The similarity solution method is supposed to be able to solve at least some nonlinear partial differential equations, in addition to linear ones. After playing around in Mathematica to find a nonlinear PDE that can be solved, I found that the general solution to $u_t^{2} = u_{xx}$ is $u = c_1(t + x) + c_2(t - x)$, where $c_1$ and $c_2$ are arbitrary functions of $t + x$ and $t - x$ respectively. So I decided to try this problem.
Using the scaling transformations $x \to px$, $t \to qt$, and $u \to ru$, I assume that $u(x,\ t)$ and $ru(px,qt)$ are similar solutions. Plugging these scaling transformations into the PDE, I get
$$\left(\frac{r}{q} u_t \right)^2 = \frac{r}{p^2} u_{xx}$$
and thus $p^2 ru_t^{2} = q^2 u_{xx}$. To be arithmetically consistent with the original PDE, it should be the case that $q = \pm p \sqrt r$, and thus the similarity solution is $ru(px,\pm p \sqrt rt)$. In turn, choosing $p = \frac{1}{x}$ yields $ru \left(\pm \frac{\sqrt rt}{x}\right)$.
At this point, do I have to proceed with the plus and minus cases as two separate branches of the problem, or can I choose which branch to use and arrive at the same solution in either case?
If I choose (or start with) the plus case, $ru\left(\frac{\sqrt rt}{x}\right)$, I can make the substitutions $v = \frac{\sqrt rt}{x}$ and $f = ru$, and plug $f(v)$ into the original PDE. However, the resulting ODE
$$\frac{d^2 f}{dv^2} + \frac{2}{v}\frac{df}{dv} = \frac{r}{v^2} \left(\frac{df}{dv} \right)^2$$
contains the scaling factor $r$. This has not happened for the linear PDEs I have solved using this method. Can I choose $r$ at will to be any function of $v$ which simplifies the ODE as much as possible, or do I have to solve for $r$ in some way?