6

Sorry if this is an easy question for some, but I have tried and failed for a while now, so I need someone else to help me.

I want to figure out why $$a=\frac{f(x)-b}{x_1}$$ is equal to $$a=\frac{y_2-y_1}{x_2-x_1}$$

For example in a task where you know to points in a linear graph, you use the second formula to find $a$.

$$A: (2, 10)\\ B: (8, 130)$$

Then $a=20$.

But why is the flipped version of $f(x)=ax+b$ equal to the direct formula $a=\frac{y_2-y_1}{x_2-x_1}$? Are they even the same? What I mean is that can the two formulas be flipped/multiplied and stuff like that to be the same?

5xum
  • 123,496
  • 6
  • 128
  • 204
  • 1
    Please read this before posting: https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference to better format your questions in future. I fixed the formatting of this first question, but you should not expect others to do this for you! – 5xum Oct 15 '18 at 09:32
  • Thank you @5xum This is my first question like this, but I will do better in the future – Adrian Fagerland Oct 15 '18 at 09:34
  • @5xum Oups, failed the formatting of my link to the formatting page. Shame on me, and thank you for putting the correct link to the mathjax tutorial – F.Carette Oct 15 '18 at 09:35
  • 1
    @AdrianFagerland Not a problem. The MathJax formatting takes some time to get used to, so when posting questions, just make your best effort. Someone will probably edit your question to make it even better, and checking what was edited is a great way to learn the syntax! – 5xum Oct 15 '18 at 12:02

2 Answers2

8

They are not equal. Your two equations feature different variables, so clearly, they cannot be the same. However, they are somewhat related, as both are closely linked to linear functions.


Short answer:

The first formula is used to calculate $a$ if you do know $b$ and you know one point on the graph of the function.

The second formula is used to calculate $a$ if you don't know $b$ and you know two points on the graph of the function.


Longer answer:

Both equations can be seen to represent the same thing, which is a linear function of $x$.

Remember: By definition, a linear function is a function of $x$ equal to $$f(x)=ax+b$$

From this equation, we can see that, by moving $b$ to the left side of the equation and dividing by $x$, the equation is equivalent to the equation $$a=\frac{f(x)-b}{x}$$ so long as $x\neq 0$.

Therefore, the above expression is an expression that is true for every point $(x,f(x))$ on the graph of the linear function.

I can use this formula to calculate $a$, for example, if I already know the value of $b$ and one single point on the line, and want to calculate $a$.


On the other hand, let's we take two points, $(x_1,y_1)$ and $(x_2,y_2)$. Then, let's imagine that the two points are on the same line, then $y_1=ax_1+b$ and $y_2=ax_2+b$. Subtracting these two equations, and some division later, we get the equation $$a=\frac{y_2-y_1}{x_2-x_1}$$

which is an equation that is true for every pair of points on the graph of the linear function.

I can use this formula to calculate $a$ if I don't know what $b$ is, so long as I know two points on the graph.


Edit:

There is also a "third", special option for calculating $a$. Let's say you happen to know two points $(x_1, y_1)$ and $(x_2, y_2)$, and the $x$ value for one of them is $0$, that is, $x_1=0$. There are now two ways of calculating $a$.

Using the fact that $f(x)=ax+b$, you can plug in $x_1=0$ and get $y_1=a\cdot 0 + b$ which means that $y_1=b$. You now know the value of $b$ and one point on the equation, which is $(x_2,y_2)$, and you can use the first formula to calculate $a$ to get $$a=\frac{f(x_2)-b}{x_2}\\ a=\frac{y_2-y_1}{x_2}\\ a=\frac{y_2-y_1}{x_2-0}\\ a=\frac{y_2-y_1}{x_2-x_1}$$

You can see that the last formula in this case is exactly the same as the second formula for calculating $a$ in your question.

5xum
  • 123,496
  • 6
  • 128
  • 204
  • Just to nitpink a bit: you have $f(0)=b$. So, knowing $b$ is the same as knowing that $(0,b)$ belongs to the graph. You can then go back to the situation where you know two points of the graph. That's where the 2 equations are linked – F.Carette Oct 15 '18 at 09:32
  • 1
    @F.Carette Thanks for the thought, I edited my answer quite a bit to explain your comment. – 5xum Oct 15 '18 at 09:38
  • @5xum "Subtracting these two equations, and some division later, we get the equation a=y2−y1x2−x1" Sorry, how would do this? – Adrian Fagerland Oct 16 '18 at 06:40
  • @AdrianFagerland Did you try subtract the equation $y_1=ax_1 + b$ from the equation $y_2=ax_2+b$? – 5xum Oct 16 '18 at 06:42
  • @5xum Yes, but I failed – Adrian Fagerland Oct 16 '18 at 06:46
  • @AdrianFagerland What did you get when you subtracted the two equations? – 5xum Oct 16 '18 at 06:47
  • @5xum ((y1-b)-(y2-b))/(x1-x2)=a-a – Adrian Fagerland Oct 16 '18 at 06:48
  • 1
    @AdrianFagerland That's not it. If you have two equations, $A=B$ and $C=D$, then subtracting the two equations yields a new equation which is $A-C=B-D$. There is no division anywhere. Please, don't tell me the result several steps in. Just tell me what you get when you SUBTRACT the two equations – 5xum Oct 16 '18 at 06:50
  • @5xum I've come this far: $y_1-y_2=ax_1-ax_2$, but I don't know where to go from here – Adrian Fagerland Oct 16 '18 at 06:54
  • 1
    @AdrianFagerland That's correct! You are two steps away. Remember the rule that $$AB + AC = A(B+C)?$$ Try to use this rule on your equation. – 5xum Oct 16 '18 at 06:58
  • @5xum I haven't learned that rule before, but I managed to use it: $(y_1-y_2)/(x_1-x_2)=a$ – Adrian Fagerland Oct 16 '18 at 07:01
  • @AdrianFagerland I highly doubt you are 15 and never heard of that rule. – 5xum Oct 16 '18 at 07:02
  • I would highly doubt that too, but it's true. We don't learn math as a set of many rules in Norway. I haven't heard of that rule, but I should have been able to figure it out. Thank you so much for your time! – Adrian Fagerland Oct 16 '18 at 07:06
  • 1
    @AdrianFagerland OK, maybe that wasn't taught to you as "this is a rule, you must learn it", but no doubt you were taught how to multiply expressions with unknown variables in it, and no doubt you sometimes "factorized" an expression (which is what that rule is) – 5xum Oct 16 '18 at 07:14
7

What is meant by all this is that if You consider an affine-linear function ( actually just the first part $x\mapsto ax$ is linear but by abuse of language one calls the affine function $f$ linear too): $$f(x)=ax+b$$ You can compute $a$ by computing for any $x_0\neq 0$: $$a=\frac{f(x_0)-b}{x_0}$$. On the other hand You know that given two points $A(x_1|y_1)$ and $B(x_2|y_2)$ and $x_1\neq x_2$ there is exactly one affine-linear function $f$ thats graph passes through these points and since the slope of an affine-linear function is everywhere the same You can compute it by the difference-quotient: $$a=\frac{y_2-y_1}{x_2-x_1}.$$ And if the above function $f$ is this one affine-linear function that has a graph passing through $A$ and $B$ then of course You have: $$\frac{y_2-y_1}{x_2-x_1}=\frac{f(x_0)-b}{x_0}$$ for any $x_0\neq 0.$

Peter Melech
  • 4,353