If f(x+1)=x^2+2, we need to rewrite the expression so as to make x+1 the basis of the expression. We can write:
x^2+2 as x^2+2x+1+1-2x=(x+1)^2+1-2x=(1+x)^2-2-2x+3=(1+x)^2-2(1+x)+3. Now replace 1+x by x: f(x)=x^2-2x+3.
Another approach is to replace x with x-1: f(x)=f(x+1-1)=(x-1)^2+2=x^2-2x+1+2=x^2-2x+3.