<s>[INST] If $f(x) = x^2 - 2x + 5$ what is $f^{-1}(x)$? 
If $f(x) = x^2 - 2x + 5$ what is $f^{-1}(x)$?
with the condition : $x > 1$

I solved this problem in this way:

$f(x) = x^2 - 2x + 5 -1 +1 \longrightarrow (x-2)^2 + 1 = f(x) $


$f^{-1}(x) = \sqrt{x-1} + 2$

But I saw someone else solved it in this way:

$f(x) = x^2 - 2x + 1 + 4  \longrightarrow  (x+1)^2 + 4 = f(x)  $


$f^{-1}(x) = \sqrt{x-4} + 1$

Which one is correct? If the second one is correct why mine is wrong?
 [/INST] $$f(x)=y= x^2-2x+5=x^2-2x+4+1=(x-1)^2+4$$
$$(x-1)^2=y-4$$
$$x-1=\pm\sqrt{y-4} $$
$$x=\pm\sqrt{y-4}+1$$
Interchange $x$ and $y$
$$f^{-1}(x)=y=\pm\sqrt{x-4}+1$$
for $x>1$ inverse of f, $f^{-1}(x)=y=\sqrt{x-4}+1$
</s>