Question

Approximating derivatives

Approximating derivatives

$$ \begin{aligned} f^{\prime}(x) & \approx\left(\delta_{+} f\right)(x)=\frac{f(x+h)-f(x)}{h} & \text { Forward difference } \\ f^{\prime}(x) & \approx\left(\delta_{-} f\right)(x)=\frac{f(x)-f(x-h)}{h} & \text { Backward difference } \\ f^{\prime}(x) & \approx(\delta f)(x)=\frac{f(x+h)-f(x-h)}{2 h} & \text { Centered difference for 1st derivative } \\ f^{\prime \prime}(x) & \approx\left(\delta^{2} f\right)(x)=\frac{f(x+h)-2 f(x)+f(x-h)}{h^{2}} & \text { Centered difference for 2nd derivative } \end{aligned} $$

1. a. Use Taylor's polynomials to derive the centered difference approximation for the first derivative:

$$ f^{\prime}(x) \approx \delta f(x)=\frac{f(x+h)-f(x-h)}{2 h}, $$

include the error in the form \(k h^{m}+O\left(h^{n}\right)\), for some \(m\) and \(n\), with \(m<n\)(find \(m, n\), and \(k\) explicitly).

b. Let \(f(1)=0\) and \(f(1.4)=0.659\). Use the centered difference approximation (with \(h=0.2\) ) to approximate \(f^{\prime}(x)\) at \(x=1.2\) (i.e. \(x-h=1, x=1.2\), and \(x+h=1.4\) ).

c. The above data were generated using the function \(f(x)=x^{2} \ln x\). Derive a bound for the error in the approximation of the derivative computed in part b. What condition on the function \(f\) is needed to guarantee this accuracy?

2. Write a short program that uses formulas (1), (3) and (4) to approximate \(f^{\prime}(1)\) and \(f^{\prime \prime}(1)\) for \(f(x)=e^{x}\) with \(h=1,2^{-1}, 2^{-2}, \ldots, 2^{-60} .\) Format your output in columns as follows:

\(h \quad\left(\delta_{+} f\right)(1)\) error \((\delta f)(1)\) error \(\left(\delta^{2} f\right)(1)\) error

Indicate the values of \(h\) (in each column) that give the least error (where, as usual, the error is the absolute value of the difference between the exact value, of the derivative, and the approximate value).

2 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Approximating derivatives
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 5. High accuracy Differentiation formulas. Using Taylor series.

    5. High accuracy Differentiation formulas. Using Taylor series.(a) Prove the following centered finite difference formula that is \(\mathrm{O}\left(\mathrm{h}^{4}\right)\) for the first derivative$$ f^{\prime}\left(x_{i}\right)=\frac{-f\left(x_{i+2}\right)+8 f\left(x_{i+1}\right)-8 f\left(x_{i}-1\right)+f\left(x_{i-2}\right)}{12 h}+O\left(h^{4}\right) $$(b) Compute the centered finite difference approximation of \(\mathrm{O}\left(\mathrm{h}^{2}\right)\) and \(\mathrm{O}\left(\mathrm{h}^{4}\right)\) for the first derivative of \(y=\sin x\) at \(x=\pi / 4\) using the value of \(h=\pi / 12\). Calculate the true percent relative error in both cases.

  • (a) Use the following data to find the velocity and acceleration at t = 10 seconds:

    Numerical methods(a)  Use the following data to find the velocity and acceleration at t = 10 seconds:Time (s):0246810121416Position (m):00.71.83.45.16.37.38.08.4Use second-order correct (i) centered finite-difference, and (ii) backward finite-difference methods. (b)  Use the Taylor expansions for f(x +h), f(x+2h), f(x +3h) and derive the following forward finite-difference formulas for the second derivative. Write down the error term$$ f^{\prime \prime}(x) \approx \frac{-f(x+3 h)+4 f(x+2 h)-5 f(x+h)+2 f(x)}{h^{2}} $$

  • Approximating derivatives f(z +h) - f(z) f(x)-f( -h) f(x + h) - f(x - h) Forward difference Backw...

    Added the formulas, thank you! Approximating derivatives f(z +h) - f(z) f(x)-f( -h) f(x + h) - f(x - h) Forward difference Backward difference Centered difference for 1st derivative s(a) (3) 2h t)-2e-bCentered diference for 2nd derivative (4) 2 2. Write a short program that uses formulas (1), (3) and (4) to approximate f(1) and f"(1) for f(x)e with h 1, 2-1, 2-2,.., 2-60. Format your output in columns as follows: h (6+f)() error (öf(1 error f error Indicate the...

  • (2 points) The area A of the region S that lies under the graph of the...

    (2 points) The area \(A\) of the region \(S\) that lies under the graph of the continuous function \(f\) on the interval \([a, b]\) is the limit of the sum of the areas of approximating rectangles:$$ A=\lim _{n \rightarrow \infty}\left[f\left(x_{1}\right) \Delta x+f\left(x_{2}\right) \Delta x+\ldots+f\left(x_{n}\right) \Delta x\right]=\lim _{n \rightarrow \infty} \sum_{i=1}^{n} f\left(x_{i}\right) \Delta x $$where \(\Delta x=\frac{b-a}{n}\) and \(x_{i}=a+i \Delta x\).The expression$$ A=\lim _{n \rightarrow \infty} \sum_{i=1}^{n} \frac{\pi}{8 n} \tan \left(\frac{i \pi}{8 n}\right) $$gives the area of the function \(f(x)=\) on...

  • Question 1 15 Points) It is always desirable to have/ use the finite difference approximation wit...

    Question 1 15 Points) It is always desirable to have/ use the finite difference approximation with error term. Please using the Taylor Series: higher order of truncation sw(x) h" +R 2! 3! (I) Derive the following forward difference approximation of the 2nd orde 2) What is the order of error for this case? derivative of f(x). f" derivative off(x) h2 Question 1 15 Points) It is always desirable to have/ use the finite difference approximation with error term. Please using...

  • Section A Q1 0 Using the following Taylor series expansion: f(x+h) = f(x)+hf'(x)+22 h 3! f"(x)+...

    Section A Q1 0 Using the following Taylor series expansion: f(x+h) = f(x)+hf'(x)+22 h 3! f"(x)+ (+0) (1.1) 4! show that the central finite difference formula for the first derivative can be written as: f'(x)= f(x+h)-f(x-1) + ch" +0(hº) (1.2) 2h Determine cp and of the derived equation. [4 marks] Consider the function: f(x) = sin +COS (1.3) 2 2 Let x =ih with n=0.25, give your answer in 3 decimals for (ii) to (vi): (ii) Evaluate f(x) for i...

  • 1-Given the function:

    1-Given the function: \(y=\frac{x^{2}-3 x-4}{x^{2}-5 x+4}\), decide if \(f(x)=y\) is continuous or has a removable discontinuity, and find horizontal tond vertical asymptotes.2 A-Use the definition \(\lim _{h \rightarrow 0} \frac{f(x+h)-f(x)}{h}\) to prove that derivative of \(f(x)=\sqrt{4-x}\) is \(\frac{-1}{2 \sqrt{4-x}}\)2 B- Evaluate the limit \(\lim _{h \rightarrow 0} \frac{f(x+h) - f(x)}{h}\) for the given value of \(x\) and function \(f(x) .\)$$ f(x)=\sin x, \quad x=\frac{\pi}{4} $$3-Given the function: \(y=(x+4)^{3}(x-2)^{2}\), find y' and classify critical numbers very carefully using first derivative tess...

  • Question 1. Compute the derivative of the following functions.

    Question 1. Compute the derivative of the following functions.(a) \(f(x)=x^{3}-\frac{2}{\sqrt{x}}+4\)(b) \(f(x)=2^{3 x-1}\)(c) \(f(x)=\ln \left(5 x^{2}+1\right)\)(d) \(f(x)=\frac{\tan (x)}{x^{2}+1}\)(e) \(f(x)=e^{x^{2}} \cdot \arctan (2 x)\)(f) \(f(x)=\sin (x)^{2} \cdot\left(\tan (x)+\cos (x)^{2}\right)\).Question 2. In geometry, the folium of Descartes is a curve given by the equation$$ x^{3}+y^{3}-3 a x y=0 $$Here, \(a\) is a constant.The curve was first proposed by Descartes in 1638 . Its claim to fame lies in an incident in the development of calculus. Descartes challenged Fermat to find the tangent line...

  • 3. Find the first derivative of a functionf(x)-ex (a) Use calculus to determine the correct value...

    3. Find the first derivative of a functionf(x)-ex (a) Use calculus to determine the correct value of the derivative at x = 2. If h = 0.25, (b) Evaluate the second-order centered finite-difference approximation (e) Evaluate the second-order forward difference approximation. (d) Evaluate the second-order backward difference approximation. (e) Create a MATLAB function program, which gives output up to second order centered finite difference approximation of second derivative "(xo). The input arguments aref n (order of approximation, 1 or 2),...

  • Consider the heat conduction problem

    5. If \(f(x)=\left\{\begin{array}{cc}0 & -2<x<0 \\ x & 0<x<2\end{array} \quad\right.\)is periodio of period 4 , and whose Fourier series is given by \(\frac{a_{0}}{2}+\sum_{n=1}^{2}\left[a_{n} \cos \left(\frac{n \pi}{2} x\right)+b_{n} \sin \left(\frac{n \pi}{2} x\right)\right], \quad\) find \(a_{n}\)A. \(\frac{2}{n^{2} \pi^{2}}\)B. \(\frac{(-1)^{n}-1}{n^{2} \pi^{2}}\)C. \(\frac{4}{n^{2} \pi^{2}}\)D. \(\frac{2}{n \pi}\)\(\mathbf{E}_{1} \frac{2\left((-1)^{n}-1\right)}{n^{2} \pi^{2}}\)F. \(\frac{4}{n \pi}\)6. Let \(f(x)-2 x-l\) on \([0,2]\). The Fourier sine series for \(f(x)\) is \(\sum_{w}^{n} b_{n} \sin \left(\frac{n \pi}{2} x\right)\), What is \(b, ?\)A. \(\frac{4}{3 \pi}\)B. \(\frac{2}{\pi}\)C. \(\frac{4}{\pi}\)D. \(\frac{-4}{3 \pi}\)E. \(\frac{-2}{\pi}\)F. \(\frac{-4}{\pi}\)7. Let \(f(x)\) be periodic...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT