Fitting a Function given 3 points

Click For Summary

Homework Help Overview

The discussion revolves around finding a polynomial function that passes through four specified points: g(-2) = 1, g(0) = 3, g(1) = -2, and g(4) = 3. Participants explore the application of polynomial interpolation methods, particularly the Lagrange interpolation formula.

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning

Approaches and Questions Raised

  • Participants discuss the necessity of using a cubic polynomial instead of a quadratic one, given the number of points. There are suggestions to include more factors in the polynomial's terms to satisfy the conditions for interpolation.

Discussion Status

Some participants have provided hints and guidance regarding the structure of the polynomial, emphasizing the need for additional terms and factors. The original poster expresses difficulty in achieving one of the required values, indicating an ongoing exploration of the problem.

Contextual Notes

There is a mention of the Lagrange interpolation formula, which suggests that the problem is framed within the context of polynomial interpolation. Participants are also considering the implications of the number of points on the degree of the polynomial needed.

shyboyswin
Messages
9
Reaction score
0

Homework Statement



Using a simple "trick," you can find a polynomial function whose graphi goes through any given set of points. For example, the graph of the following function goes through the points (1, 3), (2, 5), and (3, -1).

f(x) = 3\;\frac{(x-2)(x-3)}{(1-2)(1-3)} \;+\; 5\frac{(x-1)(x-3)}{(2-1)(2-3)} \;+\;(-1) \frac{(x-1)(x-2)}{(3-1)(3-2)}

Find a polynomial function g that satisfies g(-2) = 1, g(0) = 3, g(1) = -2 and g(4) = 3

Homework Equations



(Above)

The Attempt at a Solution



g(x) = (1)\frac{(x-1)(x-4)}{(-2-1)(-2-4)} \; + \;(-2)\frac{(x+2)(x-4)}{(1+2)(1-4)} \;+ \;3\frac{(x+2)(x-1)}{(4+1)(4-1)}

I cannot figure out how to produce g(0) = 3.
 
Physics news on Phys.org
Why are you making your polynomial a quadratic? Perhaps it should be something else -- like a cubic.
 
Hint: each "term" should have more factors in parenthesis
 
As both DH and Chaz say, you need four terms, not three, and you need three factors in numerator and denominator of each term.

A polynomial passing through f(a)= t, f(b)= u, f(c)= v, and f(d)= w must look like
t\frac{(x- b)(x- c)(x- d)}{(a- b)(a- c)(a- d)}+u\frac{(x- a)(x- c)(x- d)}{(b- a)(b- c)(b- d)}+v\frac{(x- a)(x- b)(x- d)}{(c- a)(c- b)(c- d)}+ w\frac{(x- a)(x- b)(x- c)}{(d- a)(d- b)(d- c)}

Look at what happens at, say, x= c. Every fraction except the third has a factor of x- c in the numerator and so will be 0 at x= c. The third fraction will have, at x= c, (c- a)(c- b)(c- d) in both numerator and denominator and so will be 1. The entire polynomal will be f(c)= 0+ 0+ v(1)+ 0= v.

This is the "Lagrange interpolation formula"- to write a polynomial that passes through n given points, you need a sum of n fractions, each having n-1 factors in numerator and denominator.
 
HallsofIvy said:
This is the "Lagrange interpolation formula"- to write a polynomial that passes through n given points, you need a sum of n fractions, each having n-1 factors in numerator and denominator.

I have never heard of this formula, but it is so clever! I love it :smile:

As for helping OP, all I can say is, look for the pattern, and, once you've got it, be meticulous in your bookkeeping.
 

Similar threads

Replies
9
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
4
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K