After some trial-and-error I've got this:
$$f(x;a,b)=\textrm{arctanh}\left( 2\frac{x-a}{b-a}-1 \right)$$
Illustrated here on WolframAlpha: arctanh((2*((x-a)/(b-a))-1)) where a=2 and b=12
It kind of does what I wanted, but I wonder if there are any functions like this that doesn't use trigonometric functions. Maybe something like an inverse general sigmoid function. I haven't been able to come up with anything like that.
