Exponential equation from 2 points and slope

893 Views Asked by At

Problem: I am trying to calculate the formula for an exponential equation given $2 $points and the slope, but do not know the formula to do so.

What I have tried: With a quick google search, I found out that the formula to find the equation given $2$ points is as follows:

$$\begin{aligned}&\sqrt[x_1-x_2]{\frac{y_1}{y_2}}\\a&=\frac{y_1}{b^{x_1}}\\f(x)& = ab^x\end{aligned}$$

Therefore the full equation would be: $$f\left(x\right)=\left(\frac{y_1}{\left(\sqrt[x_1-x_2]{\frac{y_1}{y_2}}\right)^{x_1}}\right)\cdot\left(\sqrt[x_1-x_2]{\frac{y_1}{y_2}}\right)^x$$


The problem with this is that it doesn't take into account the slope of the exponential function.


Above is a simple example where I have 2 exponential functions that both go through the same 2 points yet have different slopes. One of them I created using the formula above and the other one I created using a bit of guess and check.


Question: What is the formula to calculate an exponential equation given two points AND the slope.

2

There are 2 best solutions below

0
On

Note that $$ \eqalign{ & y = f(x) = a\,b^{\,x} = \,b^{\,x + c} = e^{\,u\,x + d} \quad \Rightarrow \cr & \Rightarrow \quad y' = u\,e^{\,u\,x + d} \quad \Rightarrow \quad {{y'} \over y} = u\quad \Rightarrow \cr & \Rightarrow \quad \left\{ \matrix{ \ln y = ux + d \hfill \cr \left( {\ln y} \right)' = {{y'} \over y} = u \hfill \cr} \right. \cr} $$

So that's just a linear interpolation in the plane $ x, \ln y$.

Therefore with two free parameters available you cannot have the curve to pass through two given points AND have there a given slope.

0
On

I saw this question when searching for the answer myself, so I thought I'd share what I found. I wanted an exponential function to go through two points and have a particular slope at the end point. Let's say the points are $(x_1,y_1)$ and $(x_2,y_2)$, with $\frac{dy}{dx}\rvert_{x=x_2}=s$. The functional form I chose is

$y=A e^{-\alpha (x-x_2)} + B$

This gives three equations:

(I) $y_1 = A e^{-\alpha (x_1-x_2)}+B$

(II) $y_2 = A + B$

(III) $s = -\alpha A$

After subtracting (II) from (I) and substituting for $A$ from (III), you get

$(e^{-u}-1)/u + 1/r = 0$, where

$u = \alpha (x_1-x_2)$, $r=s/m$, and $m=\frac{y_2-y_1}{x_2-x_1}$

You can solve for $u$ as

$u = W_{-1}(-r e^{-r})+r$, where $W_{-1}$ is the negative real branch of the Lambert $W$ function.

Then $\alpha = \frac{u}{x_1-x_2}$, $A=-s/\alpha$, and $B=y_2-A$.

Hope this helps.

Edit: This assumes that $\alpha>0$ and that $\lvert s \rvert <\lvert m \rvert$, with $s$ and $m$ having the same sign.