
ЛБ6 / Звіт
.pdf

d.Tables for each obtained value. i = -2, x= -0.2:
|
Difference |
Central difference |
Second difference |
|
derivative |
derivative |
derivative |
|
|
|
|
Exact value |
-4.392 |
-4.392 |
1.28 |
|
|
|
|
Formula value |
-4.31 |
-4.37 |
1.2 |
Absolute error |
0.082 |
0.022 |
0.08 |
Marginal error |
0.106 |
0.038 |
0.08 |
|
|
|
|
i = -1, x= -0.1: |
|
|
|
|
|
|
|
|
Difference |
Central difference |
Second difference |
|
derivative |
derivative |
derivative |
|
|
|
|
Exact value |
-4.214 |
-4.214 |
2.12 |
|
|
|
|
Formula value |
-4.106 |
-4.208 |
2.04 |
|
|
|
|
Absolute error |
0.108 |
0.006 |
0.08 |
|
|
|
|
Marginal error |
0.109375 |
0.022 |
0.08 |
|
|
|
|
i = 0, x= 0: |
|
|
|
|
|
|
|
|
Difference |
Central difference |
Second difference |
|
derivative |
derivative |
derivative |
|
|
|
|
Exact value |
-4 |
-4 |
2 |
|
|
|
|
Formula value |
-3.914 |
-4.01 |
1.92 |
|
|
|
|
Absolute error |
0.086 |
0.01 |
0.08 |
|
|
|
|
Marginal error |
0.1 |
0.026 |
0.08 |
|
|
|
|
i = 1, x= 0.1: |
|
|
|
|
|
|
|
|
Difference |
Central difference |
Second difference |
|
derivative |
derivative |
derivative |
|
|
|
|
Exact value |
-3.846 |
-3.846 |
0.92 |
|
|
|
|
Formula value |
-3.83 |
-3.872 |
0.84 |
|
|
|
|
Absolute error |
0.016 |
0.026 |
0.08 |
|
|
|
|
Marginal error |
0.056 |
0.042 |
0.08 |
|
|
|
|
i = 2, x= 0.2:
|
Difference |
Central difference |
Second difference |
|
derivative |
derivative |
derivative |
|
|
|
|
Exact value |
-3.848 |
-3.848 |
-1.12 |
|
|
|
|
Formula value |
-3.95 |
-3.89 |
-1.2 |
|
|
|
|
Absolute error |
0.102 |
0.042 |
0.08 |
|
|
|
|
Marginal error |
0.206 |
0.058 |
0.08 |
|
|
|
|
Conslusion: During the laboratory work, I reached several conclusions about methods for finding the derivative value of a function at a given point:
1.Methods of Calculating Derivatives:
•There are several approaches to calculating derivative values, including the forward difference, backward difference, central difference, and the formula for the second derivative.
•The central difference formula is the most accurate for finding the first derivative, as it yields the least error and provides the most precise answer. The marginal errors in the central difference formula are significantly lower than those in the forward and backward difference formulas.
2.Step Size and Accuracy:
•Before running the program to calculate derivative values at specific points, we found the values analytically to compare the absolute errors of the programmatically obtained values with the real values.
•It was observed that larger step sizes (h) results in less accurate value. Using h = 0.1 provided much more accurate answers.
3.Error Analysis:
•Analyzing the formulas to find the marginal errors for each method shows that the errors are proportional to the step size h. The forward and backward difference formulas have errors directly proportional to h, whereas the central and second difference formulas have errors proportional to 2.
•Therefore, when the step size h is smaller, the central difference formula provides more precise and accurate results than the forward difference formula. This was proven both theoretically and practically, as marginal errors for the central and second difference formulas were much smaller compared to those for the forward and backward difference formulas.