$$\begin{align}f(n+1) &= (n+2)! -1 = (n+2)(n+1)! - 1 \\ &= (n+2)\left((n+1)!-1\right) + (n+2) - 1 \\ &= (n+2) \cdot f(n) + (n+1) \end{align}$$
I understand the first line but not how to get from line 1 to line 2?
$$\begin{align}f(n+1) &= (n+2)! -1 = (n+2)(n+1)! - 1 \\ &= (n+2)\left((n+1)!-1\right) + (n+2) - 1 \\ &= (n+2) \cdot f(n) + (n+1) \end{align}$$
I understand the first line but not how to get from line 1 to line 2?
Copyright © 2021 JogjaFile Inc.
That's just the result of adding and subtracting $n+2$: $$\begin{align} (n+2)(n+1)!-1&=(n+2)(n+1)!\color{brown}{-(n+2)+(n+2)}-1\\&=(n+2)((n+1)!-1)+(n+2)-1.\end{align}$$