Expansion of functions that interpolate between two values at $\pm\infty$ I am working on a problem where I need to use a function that assumes a constant value at $\pm\infty$:
$\lim\limits_{x\to-\infty} f(x) = a$
$\lim\limits_{x\to\infty} f(x) = b$
I am interested in describing this class of functions in terms of an expansion. After thinking for a while, I realized the following expansion obeys the boundary conditions:
$f(x) = a_0 + a_1\tanh x + a_2\tanh^2 x + ... $
The problem is, I am not aware of any inner product that makes hyperbolic functions orthogonal, so that I can recover the coefficients $a_n$ from a given $f(x)$ by performing an integral. Does anyone know such expansion?
 A: Well, if you want polynomials of $\tanh x$, you don't have to use a power basis, you could as well write 
$$f(x) = a_0 + a_1\,T_1(\tanh x) + a_2\,T_2(\tanh x) +\ldots,$$
where $T_n$ are Chebyshev Polynomial of the First Kind. Chebyshev polynomials are orthogonal:
$$ \int^1_{-1}\frac{T_m(t)T_n(t)}{\sqrt{1-t^2}}\,dt =
\begin{cases}
0,  & \text{if $m\neq n$} \\
\frac{\pi}2, & \text{if $m=n\neq0$}\\
\pi, & \text{if $m=n=0$}
\end{cases}
$$
If you make the substitution $t=\tanh x$, this becomes
$$ \int^\infty_{-\infty}\frac{T_m(\tanh x)T_n(\tanh x)}{\cosh(x)}\,dx =
\begin{cases}
0,  & \text{if $m\neq n$} \\
\frac{\pi}2, & \text{if $m=n\neq0$}\\
\pi, & \text{if $m=n=0$}
\end{cases}
$$
So you can recover your coefficients as
$$a_0=\frac1\pi\int^\infty_{-\infty}\frac{f(x)}{\cosh x}\,dx$$ and 
$$a_n=\frac2\pi\int^\infty_{-\infty}\frac{f(x)T_n(\tanh x)}{\cosh x}\,dx$$ for $n\ge1$.
BTW, if you want to calculate that numerically and your software knows about complex numbers, you may be interested in the fact that $T_n(\tanh x)$ is the real part of $\displaystyle\left(\frac{e^x+i}{e^x-i}\right)^n$.
