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

39k Views Asked by At

Is there such a method to do this? I would like to come up with a logarithmic function (a graph that looks like a square root graph) that passes through two given points. Haven't had any luck in searching so far and I'm not sure where I should start.

Let's say that the points at $(1,150), (99, 300)$ for argument's sake.

3

There are 3 best solutions below

0
On

Okay, log (I will denote ln) is nice because it is "monotonically increasing", that is it is never flat, and it always goes up (there are bijections at play!)

So from this you can think of it kind of like "y=x" but shifted around a bit.

Now if I give you $y=ax+b$ you should have no problems scaling and shifting it around to go through two points. We can shift it up and down (using b) and make it tall/short using a. Using these we can get any line, as steep as we like and as up/down as we like.

So using the same methods (2 equations 2 unknowns) you should have no problem scaling $y=\ln(x)$ follows much the same logic.

There are some problems (I danced in to), so there are a few ways to interpret this

$y=a\ln(x)+b$ should work nicely using this logic.

You could also rotate!

What about this form?

(I started with $y=a(x-b)$ as being a way to shift and scale $y=x$ this is obviously wrong - left here to show my thought process)

$y=\ln(a(x-b))$ is this any use? This can stretch and shift the input to ln but expanding we see $y=\ln(a)+ln(x-b)$, this means we can move it up and down (using a) and we can move it side-to-side (using b) but we cannot stretch it up and down. So the points (1,0) and (e,1) work, because (well that IS ln), but (1,1) and (e,1) will that work? Obviously not! The line is flat, we cannot have a "vertical stretch factor" of zero in our form, which we'd need for a flat line!

Or this one?

Now you usually think of the x axis, as well... an axis, but it doesn't need to be! it can come from anywhere. We can see that $y=aln(x)+b$ is useful, we can write $b$ as $ln(b)$ (as b is just a number we fabricate, so we can do this without loss of generality.), then $y=\ln(\frac{x^a}{b})$ which is not very nice.

Why don't we just lie to $ln$ about the input, suppose $y=\ln(f(x))$ and $f(x)=ax+b$, we can decrease a to make it shallower, increase b to move it up (if a=0, then ln(b) is the y value), so this would work! We can even flip it by using negative a!

Now the reason I buggered up is because I combined scaling with translation, thinking $y=a(x-b)$ meant $y=a(x-b)+c$ that way a can be zero and it can still be shifted up. If $a=0$ then $y=a(x-b)=ax-ab=0$ (I saw the second form here in my mind).

If you have $y=ax+b$ and $y=c(x-d)+e$ you will find you can relate the two, c=a by inspection, and -cd+e =b again by inspection. Now you may pick an e, or d, suppose we pick d=10, then e=b+10a, which is fine, so we are now thinking in terms of "the line shifted to the right 10 units", we could choose d=5, and be thinking of something we moved 5 to the right. You get the idea, many transforms could make this work!

I can only apologise for the pigs ear I made of this.

0
On

We want to find $a$ and $b$ such that, say, $y=a\ln(b\,x)$, passes through the given distinct points $(x_1,y_1)$ and $(x_2,y_2)$. This leads to the $2\times 2$ system \begin{align} y_1&=a\ln(b\,x_1),\\ y_2&=a\ln(b\,x_2). \end{align} Solving for $a$ and $b$, we find $$ a={y_1-y_2\over \ln(x_1/x_2)}, \qquad b=\exp\left({y_2\ln(x_1)-y_1\ln(x_2)\over y_1-y_2}\right). $$

You can check that with these value for $a$ and $b$, indeed $y=a\ln(b\,x)$ passes through your two points $(1,150)$ and $(99,300)$.

0
On

For a graphical way of doing this geogebra is very helpful it also allows you to see / animate points and see the changes over time when and if you make changes to the logarithmic / exponetial function. See animated function below connecting two points at A and B and animating D between those two points. f(x) is just one of many functions that connects those two points.

Animated image