Solution (source code)

= Solution

Let $\epsilon$ be the group parameter. The <infinitesimal generator of a Lie point symmetry>
$$
V=t\partial_t+x\partial_x
$$
has flow equations
$$
\frac{dT}{d\epsilon}=T,
\qquad
\frac{dX}{d\epsilon}=X,
\qquad
\frac{dU}{d\epsilon}=0.
$$
Therefore it generates the scaling group
$$
\boxed{(t,x,u)\longmapsto(e^\epsilon t,e^\epsilon x,u).}
$$

Here $\xi^t=t$, $\xi^x=x$, and $\eta=0$. The total-derivative formulas for the <second prolongation of a Lie point symmetry> give
$$
\eta^t=-u_t,
\qquad \eta^x=-u_x,
$$
and
$$
\eta^{tt}=-2u_{tt},
\qquad
\eta^{tx}=-2u_{tx},
\qquad
\eta^{xx}=-2u_{xx}.
$$
Thus
$$
\boxed{
\operatorname{pr}^{(2)}V
=t\partial_t+x\partial_x
-u_t\partial_{u_t}-u_x\partial_{u_x}
-2u_{tt}\partial_{u_{tt}}
-2u_{tx}\partial_{u_{tx}}
-2u_{xx}\partial_{u_{xx}}.}
$$
For the <wave equation> expression $F=u_{tt}-u_{xx}$,
$$
\operatorname{pr}^{(2)}V(F)=-2F.
$$
It therefore vanishes whenever $F=0$, proving that $V$ generates the <simultaneous spacetime scaling symmetry of the wave equation>.

The independent invariant of the scaling orbits is the <similarity variable>
$$
z=\frac xt,
$$
while $u$ itself is invariant. Seek a <group-invariant solution> $u(t,x)=f(z)$. Direct <partial derivative>[partial differentiation] gives
$$
u_{tt}=\frac{z^2f''+2zf'}{t^2},
\qquad
u_{xx}=\frac{f''}{t^2}.
$$
The wave equation reduces to
$$
(z^2-1)f''+2zf'=0
\quad\Longleftrightarrow\quad
\frac d{dz}\left((z^2-1)f'\right)=0.
$$
Hence, on any interval avoiding $z=\pm1$,
$$
\boxed{
u(t,x)=C_0+\frac{C_1}{2}
\log\left|\frac{x-t}{x+t}\right|.}
$$