Consider the viscous Burgers’ equation $$u_t + uu_x = \nu u_{xx},\nu > 0.$$ Identify the exponents $n,m$ such that self-similar solutions of the form $u(x,t) = t^mf(xt^n)$ can be obtained. Write down the resulting ODE for the function $f$.
Letting $z=xt^n$ and using the chain rule I get the ODE $$mt^{m-1}f(xt^n)+nxt^{n+m-1}f'(xt^n)+t^{m+n}f(xt^n)f'(xt^n)-\nu t^{m+2n}f''(xt^n)=0,$$ and using $z=xt^n$ I get $$mt^{m-1}f+nzt^{m-1}f'+t^{2m+n}ff'-\nu t^{m+2n}f''=0.$$ Since I want an ODE in just $z$, I want the powers of $t$ to vanish. So I must have $m=1$, $n=-2$ which gives a power of $t^{-3}$ in the last term which is inconsistent. Can anyone see where I went wrong?
EDIT: Forgot a term of $f$ in the next last term, thanks to @mattos for pointing it out.