Find the equation of a function out of 3 points.

Arne

New member
Joined
Oct 12, 2015
Messages
8
I have an unkown polynomial p(x). That have 3 points with the coordinates p(-1)=0 and p(0)=5 and p(2) =-3
I need to find the equation for p(x)

So i figure i can set up a equation system.

Y = ax2 + bx + c

0 = a(-1)2 +b(-1) + c
5 = a0 + 0b + c
-3 = a2 + b2 + c

But when i try to solve it using the inserting method and the addition method by using c = 5 from the 2nd equation i do not get the right answer. Do i have them set up wrong?
 
I have an unkown polynomial p(x). That have 3 points with the coordinates p(-1)=0 and p(0)=5 and p(2) =-3
I need to find the equation for p(x). So i figure i can set up a equation system.
That's the standard method. And, given three points (and no other specification), one usually assumes that the polynomial p(x) is of degree two.

Y = ax2 + bx + c

0 = a(-1)2 +b(-1) + c
5 = a0 + 0b + c
-3 = a(2)2 + b2 + c
To complete the system, multiply things out:

. . . . .0 = a - b + c
. . . . .5 = c
. . . . .-3 = 4a + 2b + c

Clearly, c = 5, so plug this in:

. . . . .0 = a - b + 5
. . . . .-3 = 4a + 2b + 5

Rearrange to isolate the variables:

. . . . .-5 = a - b
. . . . .-8 = 4a + 2b

But when i try to solve it using the inserting method and the addition method by using c = 5 from the 2nd equation i do not get the right answer. Do i have them set up wrong?
Since we can't see your steps, I'm afraid it is not possible to comment on what you did or the results you got. Kindly please reply with that information, showing your steps as I did above.

Thank you! ;)
 
I have an unkown polynomial p(x). That have 3 points with the coordinates p(-1)=0 and p(0)=5 and p(2) =-3
I need to find the equation for p(x)

So i figure i can set up a equation system.

Y = ax2 + bx + c

0 = a(-1)2 +b(-1) + c
5 = a0 + 0b + c
-3 = a2 + b2 + c

But when i try to solve it using the inserting method and the addition method by using c = 5 from the 2nd equation i do not get the right answer. Do i have them set up wrong?

Depending on just how you feel about solving matrix equations vice doing some multiplying and collecting terms, there is another method to solving this kind of equation: In general we can write
y = y0 + (x-x0) f(x)
Note that this is just our old friend the slope, intercept for a straight line slightly modified so that f(x) is the slope. For our case here, we start with the easiest one and let x0=0 to get
y(x) = 5 + x f(x)
Now when x=-1 we have
0 = 5 - f(-1)
or
f(-1) = 5.
So just follow our same pattern and
f(x) = 5 + (x+1) g(x)
and
y(x) = 5 + 5 x + x (x+1) g(x)
Now let x=2 and we have
-3 = 5 + 10 + 6 g(2)
or
g(2) = -3
and, following our pattern,
g(x) = -3 + (x-2) h(x)
and
y(x) = 5 + 5 x - 3 x (x+1) + x (x+1) (x-2) h(x)

Now actually h(x) could be anything (reasonable) we wanted but generally if we have three points to fit to a polynomial, we generally stop at a quadratic so we can choose h(x)=0 and get
y(x) = 5 + 5 x - 3 x (x+1) = 5 + 2 x - 3 x2
 
Top