How do you find a and b in a ln function from (x1, y1) and (x2, y2)?

280 Views Asked by At

Like I was looking at one answer from JohnD https://math.stackexchange.com/users/52893/johnd and he answered that to find a and b of a ln function, you have to use a=y1−y2ln(x1/x2), b=exp(y2ln(x1)−y1ln(x2)y1−y2).

My question is that HOW do you get to the a and b??

Original Question: Graphing: Given two points on a graph, find the logarithmic function that passes through both.

1

There are 1 best solutions below

2
On BEST ANSWER

Another way to do it (for the same result)

Starting with $$y_1=a\log(b\,x_1)=a \log(b)+a\log(x_1)\tag 1$$ $$y_2=a\log(b\,x_2)=a \log(b)+a\log(x_2)\tag 2$$

Subtracting $(1)$ from $(2)$ $$y_2-y_1=a\log(x_2)-a\log(x_1)\implies \color{blue}{a=\frac{y_2-y_1 } {\log(x_2)-\log(x_1) }}$$ Now, rewrite $(1)$ and $(2)$ as $$\frac {y_1} a=\log(bx_1)\implies e^{\frac {y_1} a}=b x_1 \tag 3$$ $$\frac {y_2} a=\log(bx_2)\implies e^{\frac {y_2} a}=b x_2 \tag 4$$ Subtracting $(3)$ from $(4)$ $$e^{\frac {y_2} a}-e^{\frac {y_1} a}=b(x_2-x_1)\implies \color{blue}{b=\frac{e^{\frac {y_2} a}-e^{\frac {y_1} a} }{x_2-x_1 }}$$