Let  \[f(x) =
\begin{cases}
k(x) &\text{if }x>3, \\
x^2-6x+12&\text{if }x\leq3.
\end{cases}
\] Find the function $k(x)$ such that $f$ is its own inverse.
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Let  \[f(x) =
\begin{cases}
k(x) &\text{if }x>3, \\
x^2-6x+12&\text{if }x\leq3.
\end{cases}
\] Find the function $k(x)$ such that $f$ is its own inverse.
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
-\sqrt{x-3}+3
Let  \[f(x) =
\begin{cases}
k(x) &\text{if }x>3, \\
x^2-6x+12&\text{if }x\leq3.
\end{cases}
\] Find the function $k(x)$ such that $f$ is its own inverse.
train