First of all, the actual wording has only one free variable:
$$(n+1)! -1+(n+1)\cdot(n+1)! = -1 + (n+1)!\cdot(1+n+1) = (n+2)! - 1$$
All that is used are the usual distributive law, note that $(n+1)!$ is an integer just like any other and the $!$ just binds the immediately preceeding integer, and the equation
$$n! = n \cdot (n-1)!$$
Here is the same with some highlighting:
$$\begin{align*}
\color{red}{(n+1)!} \color{blue}{- 1} + (n+1) \cdot \color{red}{(n+1)!} & \stackrel{y = (n+1)!}= \color{red}y \color{blue}{-1}+(n+1)\cdot \color{red}y\\
& = \color{blue}{-1} + \color{red}y\cdot(1+(n+1))\\
& = \color{blue}{-1} + \color{red}{(n+1)!} \cdot (1 + (n+1)) \\
& = -1 +(n+1)! \cdot (n+2) \\
& = -1 + (n+2)!
\end{align*}$$