Two methods of solving function For example, f (x + 1) = x ^ 2, how does f (x) = (x + 1) ^ 2-2 (x + 1) + 1 come from

Two methods of solving function For example, f (x + 1) = x ^ 2, how does f (x) = (x + 1) ^ 2-2 (x + 1) + 1 come from

First of all, the bracket is x + 1, followed by x ^ 2, so the first term is (x + 1) ^ 2, so there is 2x + 1, so x ^ 2 = (x + 1) ^ 2-2x-1, then - 2x-1 = - 2 (x + 1) + 1, so f (x + 1) = (x + 1) ^ 2-2 (x + 1) + 1