Derivation of 3pt forward formula

In summary, the red ringing in the image is linked to the elimination of the *second* derivative terms.
  • #1
jkthejetplane
29
4
Homework Statement
3 Point forward derivation using Taylor expansion
Relevant Equations
Hi,
My homework is to derive the formula for 3 point forward difference using Taylor expansion.
I have just gotten back into school after some years off and I feel like I’m overthinking a piece to get me started.
Should I start with taking the Taylor expansion of f(x+2h) and f(x+h), subtract the later from the former, then solve for f’(x)?
I have been trying to look up how get started but I feel like I’m setting it up wrong. Anyone point me in the correct direction with an explanation?
Thanks
f(x+2h) = f(x) + 2hf’(x) + .5(2h)^2f”(x)
f(x+h) = f(x) + hf’(x) + .5h^2f”(x)

f(x+2h) - f(x+h)?

f(x+2h) - 2f(x+h)?
 
Physics news on Phys.org
  • #2
Last edited:
  • #3
Steve4Physics said:
Try this: https://www.physicsforums.com/attachments/sdfdfs-jpg.111906/

The formula at the top is the 3 point forward distance formula.
So you would start by finding f(x+h) and f(x+2h) and then the derivation is similar to the 3 point backward distance formul which is shown.

why is the formula in the red 4f(x-h)?
I was given the formula and the way I tried to derive it I felt like I was missing terms. Maybe from the 4 but I’m not sure why it’s there
 
  • #4
jkthejetplane said:
why is the formula in the red 4f(x-h)?
Whoever solved it noticed that 4f(x - h) - f(x - 2h) led to an equation involving f(x) and f'(x) and some other terms that could be ignored. It's not at all an obvious thing to do.
 
  • #5
What you do is write the 3 term expansions for f(x+h) and f(x+2h) and then eliminate the f'' term between the two equations. This will automatically deliver the 3 point 2nd order accurate forward formula for f'(x)
 
  • Like
Likes Steve4Physics and jkthejetplane
  • #6
jkthejetplane said:
why is the formula in the red 4f(x-h)?
I was given the formula and the way I tried to derive it I felt like I was missing terms. Maybe from the 4 but I’m not sure why it’s there

It’s an old image I found. The red ringing must have been associated with an acompanying explanation: it is linked to the elimination of the *second* derivative terms (see below).

Pardon the lack of Latex for equations.

In the derivation in the image, the Taylor expansions required are:

f(x-h) = f(x) – hf’(x) + f’’(x)h²/4

f(x-2h) = f(x) – 2hf’(x) + f’’(x)(2h)²/4
= f(x) – 2hf’(x) + f’’(x)h²

Note we include 2nd derivatives. Having 3 (rather than 2) points improves accuracy because we can take account both 1st and 2nd derivatives. That’s what makes a 3 point method more accurate than a 2 point method

We need to eliminate f’’(x)h² terms from and . So we multiply by 4 to give:
4f(x-h) = 4f(x) – 4hf’(x) + f’’(x)h² ③

Then ③ – ② gives:
4f(x-h) – f(x-2h) = 4f(x) – 4hf’(x) + f’’(x)h² - (f(x) – 2hf’(x) + f’’(x)h²)
= 4f(x) – 4hf’(x) - f(x) + 2hf’(x)
This eliminates the f’’(x)h² terms. You should now understand the red ringing.

After a bit of simple algebra we are left with
2hf’(x) = 3f(x) - 4f(x-h) + f(x-2h)
Q.E.D.

That the backwards difference. The forwards difference is very similar.
 
  • Like
Likes jkthejetplane
  • #7
Steve4Physics said:
It’s an old image I found. The red ringing must have been associated with an acompanying explanation: it is linked to the elimination of the *second* derivative terms (see below).

Pardon the lack of Latex for equations.

In the derivation in the image, the Taylor expansions required are:

f(x-h) = f(x) – hf’(x) + f’’(x)h²/4

f(x-2h) = f(x) – 2hf’(x) + f’’(x)(2h)²/4
= f(x) – 2hf’(x) + f’’(x)h²

Note we include 2nd derivatives. Having 3 (rather than 2) points improves accuracy because we can take account both 1st and 2nd derivatives. That’s what makes a 3 point method more accurate than a 2 point method

We need to eliminate f’’(x)h² terms from and . So we multiply by 4 to give:
4f(x-h) = 4f(x) – 4hf’(x) + f’’(x)h² ③

Then ③ – ② gives:
4f(x-h) – f(x-2h) = 4f(x) – 4hf’(x) + f’’(x)h² - (f(x) – 2hf’(x) + f’’(x)h²)
= 4f(x) – 4hf’(x) - f(x) + 2hf’(x)
This eliminates the f’’(x)h² terms. You should now understand the red ringing.

After a bit of simple algebra we are left with
2hf’(x) = 3f(x) - 4f(x-h) + f(x-2h)
Q.E.D.

That the backwards difference. The forwards difference is very similar.
Isn't this the unabridged version of what I said in my post?
 
  • Like
Likes jkthejetplane
  • #8
THANK YOU ALL. I guess i just didn't notice that the goal was to eliminate the f" term as i assumed it was the same as two point and it was the error term. I see now the error term is the f"' term which now makes sense looking back at the final equation that i was trying to derive.
Thank you again to all who contributed
-jk
 
  • #9
Chestermiller said:
Isn't this the unabridged version of what I said in my post?

Hi. Apologies. I didn’t see your post. I saw the OP’s query about the image I attached (“why is the formula in the red 4f(x-h)? ”) and just jumped in. Your post was below so I missed it.

The OP seemed to be struggling, so I expanded on the working in the image and gave the rationale. Probably too much direct help in hindsight.

I’ll take care to read all replies in future. FWIW I’ve given #5 a ‘Like’.
 

FAQ: Derivation of 3pt forward formula

What is the derivation of the 3pt forward formula?

The 3pt forward formula is a mathematical method used to approximate the first derivative of a function at a specific point. It is derived by using three points on the function and finding the slope between the first two points, then using the average of that slope and the slope between the second and third point.

Why is the 3pt forward formula used?

The 3pt forward formula is used because it is a simple and efficient way to approximate the first derivative of a function. It only requires three points, making it less computationally intensive compared to other methods.

What are the limitations of the 3pt forward formula?

The 3pt forward formula is only accurate for functions that are relatively smooth and continuous. It may not provide accurate results for functions with sharp turns or discontinuities.

How do you apply the 3pt forward formula in real-world situations?

The 3pt forward formula can be applied in various fields such as physics, engineering, and economics to estimate the rate of change of a quantity. For example, it can be used to approximate the velocity of an object based on its position data.

Are there other methods for approximating derivatives?

Yes, there are various methods for approximating derivatives such as the 2pt forward formula, the 3pt backward formula, and the central difference formula. These methods use different numbers of points and have varying levels of accuracy and complexity.

Back
Top