How to find the exponential curve between two generic points?

1.7k Views Asked by At

Given two points $P_1(x_1,y_1)$ and $P_2(x_2,y_2)$ with $y_1>0$ and $y_2>0$ I need to find the parameters $a$ and $b$ of an exponential function having the form $y=a*b^x$.

How I can solve this problem in a "generic" way getting the formulas to find $a$ and $b$ from known $P_1$ and $P_2$? I tried to find the solution by myself for two hours but I keep getting the same, wrong formulas.

2

There are 2 best solutions below

4
On BEST ANSWER

If $y_1=ab^{x_1}$ and $y_2=ab^{x_2}$, then$$\frac{y_2}{y_1}=\frac{ab^{x_2}}{ab^{x_1}}=b^{x_2-x_1}.$$So, take $b=\left(\dfrac{y_2}{y_1}\right)^{1/(x_2-x_1)}$. And now $a=\dfrac{y_1}{b^{x_1}}$.

0
On

Taking the logarithms of the desired identities $y_j = a b^{x_j}$ gives a linear equation system $$ \begin{align} 1 \cdot \log a + x_1 \cdot \log b = \log y_1 \\ 1 \cdot\log a + x_2 \cdot\log b = \log y_2 \end{align} $$ which can be solved for $(\log a,\log b)$ with the usual methods. The determinant of the coefficient matrix is $x_2 - x_1$, so that a unique solution exists if $x_1 \ne x_2$: $$ \log a = \frac{\begin{vmatrix} \log y_1 & x_1 \\ \log y_2 & x_2\end{vmatrix}}{x_2 - x_1} = \frac{x_2 \log y_1 - x_1 \log y_2}{x_2 - x_1} $$ and $$ \log b = \frac{\begin{vmatrix} 1 & \log y_1 \\ 1 & \log y_2 \end{vmatrix}}{x_2 - x_1} = \frac{\log y_2 - \log y_1}{x_2 - x_1} $$