Numerical algorithm for finding the inverse of a function Is there a numerical method to approximate the inverse of a function for a given interval?
Thank you
 A: Suppose that you have $y=f(x)$ and you want to have an approximation $x=g(y)$ valid over a rnage $ a \leq  x \leq b$.
What you can do is to expand $f(x)$ as a Taylor series built around $x=c=\frac{a+b}2$ and get
$$y=f(c)+ f'(c)(x-c)+\frac{1}{2}  f''(c)(x-c)^2+\frac{1}{6} f'''(c)
   (x-c)^3+O\left((x-c)^4\right)$$ and then use series reversion to get
$$x=c+\frac{1}{f'(c)}(y-f(c))-\frac{ f''(c)}{2 f'(c)^3}(y-f(c))^2+\frac{ 3
   f''(c)^2-f'''(c) f'(c)}{6 f'(c)^5}(y-f(c))^3+O\left((y-f(c))^4\right)$$
Let us take the basic $f(x)=e^x$ with $a=-\frac 12$ and $b=\frac 12$
$$x=(y-1)-\frac{1}{2} (y-1)^2+\frac{1}{3} (y-1)^3+O\left((y-1)^4\right)$$ Now, for testing, assign a value to $x$ in order to get $y$ and recompute $x$ by the approximation formula. This will give
$$\left(
\begin{array}{cc}
 -0.5 & -0.491184 \\
 -0.4 & -0.395969 \\
 -0.3 & -0.298573 \\
 -0.2 & -0.199684 \\
 -0.1 & -0.099978 \\
 +0.0 & +0.000000 \\
 +0.1 & +0.100028 \\
 +0.2 & +0.200511 \\
 +0.3 & +0.302933 \\
 +0.4 & +0.410535 \\
 +0.5 & +0.529304
\end{array}
\right)$$ For sure, with more terms in the first expansion the comparison will be batter.
