Welcome to Approximating Functions!
In your previous math studies, you’ve usually started with a formula and used it to find coordinates. But what happens if you have the coordinates first? In the real world—like in engineering or weather forecasting—we often have a list of data points but no formula to connect them.
In this chapter, we will learn two clever ways to "connect the dots" by creating a polynomial that fits our data perfectly. This allows us to predict values between our data points. Don’t worry if this seems a bit abstract at first; it’s essentially just a sophisticated way of finding a "line of best fit" that happens to be a curve!
1. Newton’s Forward Difference Interpolation
Newton’s method is a fantastic tool used when your x-values are equally spaced (for example, \(x = 1, 2, 3, 4...\)). It uses something called a Difference Table to build a formula.
The Difference Table: Step-by-Step
Before using the formula, you need to build a table. Let's say you have values for \(x\) and \(f(x)\).
1. Write your \(x\) values in the first column and your \(f(x)\) values in the second.
2. First Differences (\(\Delta\)): Subtract the first \(f(x)\) value from the second, the second from the third, and so on. Write these in a new column.
3. Second Differences (\(\Delta^2\)): Do the same thing using the numbers in the "First Difference" column.
4. Keep going until your differences become constant (the same number) or you run out of data.
Quick Review: The notation \(\Delta f(x)\) is just a fancy way of saying "the change in the function." It is calculated as:
\( \Delta f(x) = f(x+h) - f(x) \)
Where \(h\) is the "step size" (the distance between your \(x\) values).
The Magic of Constant Differences
Did you know? If the 2nd differences are all the same number, your data fits a quadratic (\(x^2\)) perfectly. If the 3rd differences are constant, it’s a cubic (\(x^3\)). This is a great way to "reconstruct" a hidden polynomial!
Using the Formula
The formula looks intimidating, but remember: it is provided in your formula booklet! Your job is simply to pick the correct values from the top row of your difference table and plug them in.
The formula uses a variable \(p\), which represents how far along the \(x\)-axis you are from your starting point: \(p = \frac{x - x_0}{h}\).
Common Mistake to Avoid: Always check that your \(x\) values are equally spaced before starting. If they are not (e.g., \(x = 1, 2, 5, 10\)), Newton’s method will not work, and you must use Lagrange’s method instead!
Key Takeaway: Newton's method is the "Equal Step" method. If the \(n^{th}\) differences are constant, you have found an \(n^{th}\) degree polynomial.
2. Lagrange’s Interpolating Polynomial
What if your data points are scattered randomly? Maybe you measured a plant's height on Day 1, Day 2, and then forgot until Day 7. Because the intervals are not equal, Newton's table fails. This is where Lagrange’s Form saves the day.
How it works: The "Weighting" Analogy
Think of Lagrange’s method like a custom-made suit. For every data point you have, we create a specific mathematical "term" that is "on" (equal to the \(y\)-value) when we are at that point, and "off" (equal to zero) when we are at any other data point from our list.
If you have \(n + 1\) data points, you can create a polynomial of degree \(n\).
Example: If you have 3 points, you can make a quadratic (\(x^2\)). If you have 4 points, you can make a cubic (\(x^3\)).
The Formula Structure
Again, the formula is in your booklet, but here is the "trick" to writing it out manually without getting confused:
For each point \((x_i, y_i)\), the term looks like a fraction multiplied by \(y_i\).
1. The Numerator: Multiply together \((x - \text{every other x-value})\).
2. The Denominator: Multiply together \((\text{current x-value} - \text{every other x-value})\).
3. The Result: Multiply that fraction by the \(y\)-value for that point.
Encouraging phrase: This involves a lot of brackets and can look messy! Take your time, use plenty of space on your paper, and double-check your subtractions.
Example of a term for the first point \((x_0, y_0)\) in a set of three points:
\( L_0(x) = \frac{(x - x_1)(x - x_2)}{(x_0 - x_1)(x_0 - x_2)} \times y_0 \)
Quick Review:
• Newton: Use for equal intervals. Uses a difference table.
• Lagrange: Use for any intervals. Use the "weighting" formula.
Key Takeaway: Lagrange is the "Universal" method. It works for any data set, but the algebra can get "clunky" if you have many points.
Summary and Tips for Success
Which method should I use?
In the exam, the question might tell you which to use. If it doesn't:
• Look at the \(x\) values. Are they \(0, 1, 2, 3\)? Use Newton. It's much faster to calculate.
• Are they \(1, 2.5, 7, 8\)? Use Lagrange. It’s your only choice!
Memory Aid: "L" for Lagrange and "L" for Loose
Remember: Lagrange is for Loose data (data that isn't spaced out strictly). Newton is for "Numerical" order (neatly spaced data).
Final Check:
• Did you include the \(y\)-values in your final polynomial?
• Did you remember that \(n+1\) points means the highest power is \(x^n\)?
• If you are approximating a value, does your answer look sensible? If your \(y\) values are between 10 and 20, and your answer is 500, go back and check your signs!
Don't worry if this feels like a lot of arithmetic. The more you practice building the difference tables and setting up the Lagrange fractions, the more natural it will feel. You've got this!