Rayan A. answered 11/30/22
STEM Major @ Stanford - Here To Meet Your Tutoring Needs :)
So to start off, let's just think about the information we have on hand.
You know we want set-up two types of equations:
y = mx + b
and
f(x) = ?
We also have f(1) = 6 and f(-2) = -3
One important thing to note is that f(x) really is just y.
It means you're plugging in x into some function and getting some output out of it...and that output? y!
Now with that in mind, let's try figuring out what we're missing.
y = mx + b, we want to figure out m and b.
Well, to start we could try plugging in our values for x and y given.
For f(1) = 6, we get:
6 = m(1) + b
as y = 6 and x = 1
For f(-2) = -3, we get:
-3 = m(-2) + b
We have two variables and two equations...I think we can solve for them :)
The way I'll go about it is to maybe see what variable I can isolate. Let's try setting the equations equal to each other.
We can do this by subtracting 6 from both sides on our first equation giving us:
6 - 6 = m + b - 6
0 = m + b - 6
For the second we can add 3 to both sides
-3 + 3 = -2m + b + 3
0 = -2m + b + 3
We can then set them equal to each other on the 0 side:
m + b - 6 = -2m + b + 3
Although our m's are different, it looks like we can subtract b from both sides, isolating one variable!
m - 6 = -2m + 3
We then solve for m by isolating it
3m = 9
m = 3
Great! We have one variable. y = 3x + b...almost there.
Lets plug in one of our f() values given into the equation (doesnt matter which one):
I'll do f(1) = 6
6 = 3(1) + b
6 = 3 + b
b = 3
Awesome!!!
Now we finally have our form:
y = 3x + 3
which is f(x) = 3x + 3
And we can double check if we want to be extra sure:
Lets plug in x = 1 and x = -2
y = 3(1) + 3 = 6
y = 3(-2) + 3 = -3
Which makes sense, since f(1) = 6 and f(-2) = -3 !!!!
So we know we have the right answer :)