Finding the Inverse of $\frac{\phi_1}{(1-x)^2}-\phi_0$

40 Views Asked by At

I am trying to find the inverse of

$$y = \frac{\phi_1}{(1-x)^2}-\phi_0$$

where $\phi_0,\phi_1$ are contants. I tried using logs,

$$ \log ( y + \phi_0) = \log(\phi_1) - 2 \log(1-x)$$

$$ ( \log ( y + \phi_0) - \log(\phi_1) ) / -2 = \log(1-x) $$

$$ \exp ( \frac{( \log ( y + \phi_0) - \log(\phi_1) )}{-2}) = 1-x $$

$$ 1-\exp ( \frac{( \log ( y + \phi_0) - \log(\phi_1) )}{-2}) = x $$

This gives strange results

def y(lam,phi0,phi1):
    return ( (phi1 / (1.0-lam)**2) - phi0)

def y_inv(x,phi0,phi1):
    return 1.0 - np.exp ((np.log(x+phi0) - np.log(phi1)) / -2.0)

lam = 10.0
print y_inv(y(lam,10.0,20.0),10.0,20.0)

Says -8.0

Any reason anyone can think of this will not work?

Thanks,

3

There are 3 best solutions below

0
On BEST ANSWER

Why $ \log$ ??? We have $y+\phi_0=\frac{\phi_1}{(1-x)^2}$, or

$(1-x)^2= \frac{\phi_1}{y+ \phi_0}$. This gives a quadratic equation for $x$.

0
On

let $$y=\frac{a}{(1-x)^2}-b$$ then we have $$y+b=\frac{a}{(1-x)^2}$$ and $$(1-x)^2=\frac{a}{y+b}$$ and we get $$|1-x|=\sqrt{\frac{a}{y+b}}$$ if $$\frac{a}{y+b}\geq 0$$ this equation has two solutions

0
On

There are some typos in your formulas.

If you really want to use logarithms to solve this for $x$, then you have to consider several cases:

$$y = \frac{\phi_1}{(1-x)^2}-\phi_0$$

$1)$ $y - \phi_0 >0$ and $ \phi_1 >0$. Then you can write:

$$\log (y-\phi_0)=\log \phi_1-2 \log|1-x|$$

$$\log|1-x|=\frac{1}{2} (\log \phi_1-\log (y-\phi_0))$$

$$\log|1-x|=\log \sqrt{ \frac{ \phi_1}{y- \phi_0}}$$

$$|1-x|=\sqrt{ \frac{ \phi_1}{y- \phi_0}}$$

Two solutions here, as the other users said.

$2)$ $y - \phi_0 <0$ and $ \phi_1 <0$. Then you can write:

$$\log (\phi_0-y)=\log (- \phi_1)-2 \log|1-x|$$

The rest continues in the same fashion and gives the same two solutions.

Other cases don't give any solutions, since they are inconsistent.