Fitting a Function given 3 points

In summary, to find a polynomial function that passes through a given set of points, we can use the Lagrange interpolation formula, which involves using a sum of fractions with a specific pattern of factors in the numerator and denominator. By carefully following this pattern, we can find the desired polynomial function.
  • #1
shyboyswin
9
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).

[tex]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)}[/tex]

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



[tex]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)}[/tex]

I cannot figure out how to produce g(0) = 3.
 
Physics news on Phys.org
  • #2
Why are you making your polynomial a quadratic? Perhaps it should be something else -- like a cubic.
 
  • #3
Hint: each "term" should have more factors in parenthesis
 
  • #4
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
[tex]t\frac{(x- b)(x- c)(x- d)}{(a- b)(a- c)(a- d)}+[/tex][tex] u\frac{(x- a)(x- c)(x- d)}{(b- a)(b- c)(b- d)}+[/tex][tex] v\frac{(x- a)(x- b)(x- d)}{(c- a)(c- b)(c- d)}[/tex][tex]+ w\frac{(x- a)(x- b)(x- c)}{(d- a)(d- b)(d- c)}[/tex]

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.
 
  • #5
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.
 

What is the purpose of fitting a function given 3 points?

The purpose of fitting a function given 3 points is to find a mathematical equation that accurately represents the relationship between the three given points. This can help to make predictions or analyze data in a more efficient manner.

What are the key steps in fitting a function given 3 points?

The key steps in fitting a function given 3 points include plotting the points on a graph, determining the type of function that best fits the data (linear, quadratic, exponential, etc.), and using the points to solve for the coefficients or parameters of the function.

What assumptions are made when fitting a function given 3 points?

One major assumption is that the data is linearly related, meaning that it can be represented by a straight line. Additionally, it is assumed that the three points are accurately measured and represent the true relationship between the variables being studied.

What is the difference between interpolation and extrapolation when fitting a function given 3 points?

Interpolation involves using the given points to estimate values within the range of the data, while extrapolation involves using the points to estimate values outside of the range of the data. Extrapolation carries a higher risk of error, as it is based on assumptions about the data outside of the given points.

What should be considered when choosing a function to fit 3 points?

When choosing a function to fit 3 points, it is important to consider the shape of the data and the type of relationship between the variables. It may also be helpful to consider the simplicity of the function and how well it fits the given points. It is also important to assess the accuracy of the function by comparing it to additional data points, if available.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
3
Views
479
  • Precalculus Mathematics Homework Help
Replies
6
Views
499
  • Precalculus Mathematics Homework Help
Replies
11
Views
218
  • Precalculus Mathematics Homework Help
Replies
6
Views
1K
  • Precalculus Mathematics Homework Help
Replies
10
Views
766
  • Precalculus Mathematics Homework Help
Replies
10
Views
476
  • Precalculus Mathematics Homework Help
Replies
7
Views
684
  • Precalculus Mathematics Homework Help
Replies
10
Views
548
  • Precalculus Mathematics Homework Help
Replies
7
Views
1K
  • Precalculus Mathematics Homework Help
Replies
14
Views
840
Back
Top