Approximated second derivative

72 Views Asked by At

Approximated second derivative of $y(0)''$ function $y(x)$ at x = 0 difference quotient, using the values ​​of $y(x)$ at the sites of the three-point template $ {x}_{1} = \frac {-4h} { 5}, {x} _ {2} = 0, {x} _ {3} = \frac {h} {5} $.

Calculate the difference quotient value (approximate value of $y '' (0)$) for $ y (x) = {x} ^ {3} $ when $h = 0.05$. The result is rounded to hundredths.

Decision:

$y''= \frac{{y} _ {i +1} -2 {y} _ {i} + {y} _ {i-1}} {{h} ^ { 2}}$

$y _ {i + 1} = {\frac {-4 (0.05)} {5}} ^ {3}$

$y _ {i} = 0$

$y _ {i-1} = {\frac {(0.05)} {5}} ^ {3}$

=> $y'' = - 0.03$

The obvious answer is $-0.03$.

But the authors insist that the answer is $-0.06$.

Please help me understand where they got the multiplication by $2$ ? I can not understand. Thanks in advance.

3

There are 3 best solutions below

4
On

Your approximation formula is correct. However, I don't get x1 and x3. They should be equal to -h and h respectively.

BTW, if $x_1=−\frac{4h}{5}$ and $x_3=\frac{h}{5}$ then $y_{i - 1} = (−\frac{4h}{5})^3$ and $y_{i + 1} = (\frac{h}{5})^3$.

If you want to use these values, you should use this formula: $\frac{y_{i + 1} - 2y_{i} + y_{i - 1}}{\frac{17}{50}h^2}$

Note that there are infinitely many formulae to approximate any derivative. Their difference is the speed at which they approach the exact answer. The simplest way to check whether an approximation is correct or not is through Hopital's rule.

0
On

The formula you use applies to equal spacing only. For your template do the following:

The first derivatives are defined as

$$ \begin{align} y'_p(x_p) & = \frac{y_2-y_1}{x_2-x_1} & x_p & = \frac{x_1+x_2}{2} \\ y'_n(x_n) & = \frac{y_3-y_2}{x_3-x_2} & x_n & = \frac{x_3+x_2}{2} \end{align} $$

So the second derivative is

$$ y''(x_2) = \frac{ y'_n - y'_p}{x_n-x_p} = \frac{ \frac{y_3-y_2}{x_3-x_2} - \frac{y_2-y_1}{x_2-x_1} }{ \frac{x_3+x_2}{2} - \frac{x_2+x_1}{2} } = \\ = \frac{ \frac{h^3/125}{h/5} - \frac{64 h^3/125}{4 h/5} }{ \frac{h/5}{2} - \frac{-4 h/5}{2} } = - \frac{6}{5} h = -0.06 $$

0
On

To compute $y''(x)$ from $y(x-4h)$, $y(x)$ and $y(x+h)$ use their Taylor expansions $$ y(x-4h)=y(x)-4hy'(x)+8h^2y''(x)-\frac{32}3h^3y'''(x)+O(h^4)\\ y(x+h)=y(x)+hy'(x)+\frac12h^2y''(x)+\frac{1}6h^3y'''(x)+O(h^4)\\ $$ where you see that to eliminate $y(x)$ and $y'(x)$ you have to combine to $$ y(x-4h)+4y(x+h)-5y(x)=10h^2y''(x)-10h^3y'''(x)+O(h^4) $$ or $$ \frac{y(x-4h)-5y(x)+4y(x+h)}{10h^2}=y''(x)-hy'''(x)+O(h^2) $$ For your question you have then to replace $h$ by $h/5$.