Introduction : In this solution, we will calculate percent relative error in second derivative approximation. First we derive formula for second derivative approximation using Taylor series.
Question: Derive following formula for second derivative approximation using Taylor series
\[f(x_i+∆x)+f(x_i-∆x)=2f(x_i)+∆x^2f”(x_i)\]
use this formula for the function
\[f\left(x\right)=e^{2x}\left(3x^2-6x+2\right)\]
to calculate percent relative error in second derivative approximation using following data in the table
x | F(x) |
1.6 | 1.96 |
1.7 | 14.08 |
1.8 | 33.67 |
Solution:
We know Taylor series expansion
\[f(x_i+∆x)=f(x_i)+∆xf'(x_i)+\frac{∆x^2}{2!}f”(x_i)+O(∆x^3) \] (1)
similarly
\[f(x_i-∆x)=f(x_i)-∆xf'(x_i)+\frac{∆x^2}{2!}f”(x_i)-O(∆x^3) \] (2)
Adding equations (1) and (2)
\[f(x_i+∆x)+f(x_i-∆x)=2f(x_i)+2*\frac{∆x^2}{2!}f”(x_i)+O(∆x^4)\]
or
\[f(x_i+∆x)-2f(x_i)+f(x_i-∆x)=∆x^2f”(x_i)+O(∆x^4)\]
dividing by ∆x^2, we get
\[f^{\prime\prime}\left(x_i\right)=\frac{f(x_i+∆x)-2f(x_i)+f(x_i-∆x)}{∆x^2}+O(∆x^2)\]
is the required formula for second derivative approximation
clearly Order of accuracy of this formula is
\[O(∆x^2)\]
now for the given function
\[f\left(x\right)=e^{2x}\left(3x^2-6x+2\right)\]
and from the data table, we calculate
\[f^{\prime\prime}\left(1.7\right)=\frac{f\left(1.8\right)-2f\left(1.7\right)+f\left(1.6\right)}{{0.1}^2}\]
\[f^{\prime\prime}\left(1.7\right)=\frac{33.67-2\ast14.08+1.96}{0.01}\]
=747
Now we find Exact first derivative
\[f'(x) =2e^{2x}\left(3x^2-6x+2\right)+e^{2x}\left(6x-6\right)\]
and the exact second derivative
\[f^{\prime\prime}\left(x\right)=e^{2x}\left(12x^2-10\right)\]
now calculating it’s exact value
\[f^{\prime\prime}\left(1.7\right)=e^{2\ast1.7}\left(12\ast{1.7}^2-10\right)\]
\[f^{\prime\prime}\left(1.7\right)=739.514\]
So the % Relative error
\[=\left|\frac{approximate-exact}{exact}\right|\ast100%\]
\[=\left|\frac{747-739.514}{739.514}\right|\ast100%\]
\[=0.011\ast100%\]
=1.1%