[Math] bijection from $(a,b)$ to $\Bbb R$

elementary-functionsfunctionsgeneral-topology

I need to construct a bijection from an arbitrary interval $(a,b) \to\Bbb R$. I was thinking of somehow using the tangent function because it's asymptotic, but i'm not sure how to get started.

Best Answer

Even easier: assuming $a<b$, consider $f:(a,b)\to\mathbb{R}$ given by $$ f(x) = \frac{1}{x-a}+\frac{1}{x-b}. $$ $f(x)$ is monotonic over the interval $(a,b)$ since $f'(x)<0$ and $$ \lim_{x\to a^+}f(x)=+\infty,\qquad \lim_{x\to b^-}f(x)=-\infty. $$