8
$\begingroup$

let be the equation $ y-f(x)=0 $ the idea is to get $ s=g(y) $ that is x as a function of 'y'

can this be made by a root finding algorithm ?? i mean you treat $ y $ as a numerical free parameter and find the roots of $ y-f(x)=0 $ in general these roots will depend on 'y' so we can represent every solution of $ y-f(x) $ for different parameters of 'y'

for example in Newton's method

$ x_{n+1} (y)=x_{n} (y)- \frac{y-f(x)}{-f'(x)} $

  • 0
    @JoseGarcia : See [Brent's method](http://en.wikipedia.org/wiki/Brent%27s_method) for improved convergence if Newton fails (i.e. if the derivative is too small).2012-08-27

2 Answers 2

4

The inverse of a single-variable function is a reflection over the line $y = x$. If you want the numerical inverse, just flip the coordinates. For example,

Function:

y = f(x); plot(x,y); 

Inverse

y = f(x); plot(y,x); 
1

If you are interested in getting the values of $x$, given the value of $y$ then your method works fine.

On the other hand if you are interested in obtaining a closed form expression of $x$ in terms of $y$ (treating $x$ and $y$ as symbol parameters) then the problem boils down to computing $f^{-1}$, given $f$ because $y=f(x)\Rightarrow x=f^{-1}(y)$. Now for different $f$, algorithms for computing $f^{-1}$ are different, like if $f$ is linear then the problem boils down to the inversion of a matrix.

  • 0
    Though, as André notes in his comment, one could use Newton's method to derive a series expansion for the inverse function...2012-07-28