0% found this document useful (0 votes)
12 views

Numerical Differentiation Approximations and Error Analysis

The document discusses numerical differentiation methods to estimate the first derivative of a polynomial function and the second derivative of the sine function. It presents calculations using forward, backward, and centered difference approximations with varying step sizes, highlighting the errors in each method. The centered difference approximation is found to be the most accurate for the first derivative, while the document also outlines the process for estimating the second derivative of the sine function.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Numerical Differentiation Approximations and Error Analysis

The document discusses numerical differentiation methods to estimate the first derivative of a polynomial function and the second derivative of the sine function. It presents calculations using forward, backward, and centered difference approximations with varying step sizes, highlighting the errors in each method. The centered difference approximation is found to be the most accurate for the first derivative, while the document also outlines the process for estimating the second derivative of the sine function.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Numerical Differentiation Approximations and Error Analysis

Question:
Use forward & backward difference approximations of O(h) and a centered difference approximation of
O(h²) to estimate the first derivative of the function:
f(x) = -0.1x⁴ - 0.15x³ - 0.5x² - 0.25x + 1.25
at x = 0.5 using step size h = 0.5. Repeat the computation using h = 0.25.
Note that the derivative can be calculated directly as:
f'(x) = -0.4x³ - 0.45x² - 1.0x - 0.25, (Analytical Derivative)
and can be used to compute the true value as f'(0.5) = -0.9125.

Step Size h = 0.5

Let:

• 𝑥𝑖−1 = 0, 𝑓(𝑥𝑖−1 ) = 1.2


• 𝑥𝑖 = 0.5, 𝑓(𝑥𝑖 ) = 0.925
• 𝑥𝑖+1 = 1.0, 𝑓(𝑥𝑖+1 ) = 0.2

Forward Difference Approximation:


0.2 − 0.925
𝑓 ′ (0.5) ≈ = −1.45
0.5
Error Calculation:

True value f'(0.5) = -0.9125

−1.45 − (−0.9125)
∴ |ε𝑡 | = | | × 100% = 58.9%
−0.9125

Further Analysis for h = 0.5

Backward Difference:
0.9125 − 1.2
𝑓 ′ (0.5) ≈ = −0.55
0.5
−0.55 − (−0.9125)
∴ |𝜀𝑡 | = | | × 100% = 39.7%
−0.9125

Centered Difference:
0.2 − 1.2
𝑓 ′ (0.5) ≈ = −1.0
2 × 0.5

Prepared by Sadia Tasnim


−1.0 − (−0.9125)
∴ |𝜀𝑡 | = | | × 100% = 9.6%
−0.9125

Repeat calculations using h = 0.25 for improved accuracy.

Step Size h = 0.25

Forward Difference:

• f'(0.5) ≈ -1.155

• Error | εt | = 26.5%

Backward Difference:

• f'(0.5) ≈ -0.714

• Error | εt | = 21.7%

Centered Difference:

• f'(0.5) ≈ -0.934

• Error | εt | = 2.4%

Conclusion: The centered difference approximation is more accurate than forward or backward
differences.

𝜋 𝜋
Question: Approximate the second derivative of 𝑓(𝑥) = 𝑠𝑖𝑛(𝑥) at 𝑥 = with step size ℎ = .
4 10
Compare forward, backward & centered finite divided difference by estimating the error.

Solution:

xi-2 xi-1 xi xi+1 xi+2


𝜋 3𝜋 𝜋 7𝜋 9𝜋
20 20 4 20 20
f(xi-2) f(xi-1) f(xi) f(xi+1) f(xi+2)

0.156434 0.453990 0.7071068 0.891007 0.987688

Given function, 𝑓(𝑥) = 𝑠𝑖𝑛(𝑥)

1st derivative, 𝑓 ′ (𝑥) = 𝑐𝑜𝑠(𝑥) & 2nd derivative, 𝑓 " (𝑥) = − 𝑠𝑖𝑛(𝑥)
𝜋 𝜋 𝜋
At 𝑥 = , the second derivative of 𝑓(𝑥) = 𝑠𝑖𝑛(𝑥) 𝑖𝑠 𝑓 " ( ) = − 𝑠𝑖𝑛( ) ≈ − 0.7071
4 4 4

Prepared by Sadia Tasnim


∴ 𝑇𝑟𝑢𝑒 𝑣𝑎𝑙𝑢𝑒 = − 0.7071

Type Approximate value Error

Forward finite- 𝑓(𝑥𝑖+2 ) − 2𝑓(𝑥𝑖+1 ) + 𝑓(𝑥𝑖 ) −0.8837 − (−0.7071)


divided- 𝑓 " (𝑥𝑖 ) = |
−0.7071
|
ℎ2
difference × 100%

Or, = 24.98%
0.987688 − 2 × 0.891007 + 0.7071068
𝑓 " (𝑥𝑖 ) =
𝜋 2
( )
10

Or, 𝑓 " (𝑥𝑖 ) = − 0.8837

Backward 𝑓(𝑥𝑖 ) − 2𝑓(𝑥𝑖−1 ) + 𝑓(𝑥𝑖−2 ) Do yourself


finite-divided- 𝑓 " (𝑥𝑖 ) =
ℎ2
difference
Do yourself

Centered 𝑓(𝑥𝑖+1 ) − 2𝑓(𝑥𝑖 ) + 𝑓(𝑥𝑖−1 ) Do yourself


finite-divided- 𝑓 " (𝑥𝑖 ) =
ℎ2
difference
Do yourself

Prepared by Sadia Tasnim

You might also like