Finding a logarithmic function from a graph

Here's the graph. When I use the points $(-1,1)$ or $(-3,2)$ to use in the equation $a\log(-x-1)+k$, I can't find a finite value for k. Any ideas?

-
It should probably be $-x+1$ in the argument of $\log$. When $x=0$, you want to take $\log 1$, not $\log(-1)$. –  Rahul Aug 27 '12 at 7:35
Appreciate your help but the vertical asymptote is x=1 so shouldn't the log argument be (x-1)? Since the graph is going away from 0, it would be (-x-1), no? –  Mark Aug 27 '12 at 7:39

It looks like a mirror image of $\log(x)$ around $x=\frac 12$ with a vertical stretching so that the equation could be : $$\alpha \log(1-x)$$ Since $\alpha \log(1-(-3))=2$ I would say that $\alpha=\frac 2{\log(4)}$ with the final : $$\frac {\log(1-x)}{\log(2)}$$ corresponding to the picture :

-
I understand how you got to alog(2) but I'm not so clear how you got to a = 2/(log(4)) since there is a k variable in the equation above. –  Mark Aug 27 '12 at 7:45
@Mark: for $x=-3$ we observe $y=2$ so that replacing in $y=\alpha\log(1-x)$ I get $2=\alpha\log(4)=\alpha\log(2^2)=\alpha\ 2\log(2)$ and dividing by $2\log(2)$ we get $\alpha$. –  Raymond Manzoni Aug 27 '12 at 7:50
@Mark : I didn't consider $a\cdot \log(-x-1)+k$ since it is clearly wrong ($\log(-x-1)$ should be $\log(1-x)$ and if $k$ is not a constraint but a parameter to find it is simply $0$). –  Raymond Manzoni Aug 27 '12 at 7:54
Oh I see, so to find k you just make it zero in order to find a first. Then sub a along with another point to find k to find the log function altogether. –  Mark Aug 27 '12 at 7:57
@Mark: if $y=a \log(1-x)+k$ then $k$ is the vertical value for $x=0$ but it is clearly $0$ on the picture so that $k=0$ (you may find it first). After that you consider the other value $x=-3$ getting $a=\frac 1{\log(2)}$ and finally you observe that it works too with $x=-1$. –  Raymond Manzoni Aug 27 '12 at 8:01

You're solving for two parameters with two linear equations. Check it out: $$y_1 = a \log(-x_1+1) + k$$ $$y_2 = a \log(-x_2+1) + k$$ So solve for $a,k$ as though all other variables are constant: $$y_1-y_2 = a(\log(-x_1+1) - \log(-x_2+1)) = a \log \frac{-x_1+1}{-x_2+1}~~,$$ and we find $a = \dfrac{y_1-y_2}{\log \frac{-x_1+1}{-x_2+1}}$ . Plugging in $a$ into either initial equation will yield $k$ .

In our particular example, we can use $(x_1,y_1) = (-1,1), (x_2,y_2) = (-3,2)$ to find that $a = \dfrac{-1}{\log \frac{1}{2}} = \dfrac{1}{\log 2}$ and so we find $k$ from the fact that $$1 = \frac{\log2}{\log2}+k = 1+k~~,$$ and so $k = 0$.

-