Here is a question about numerical computing, more specifially about solving non
ID: 3010009 • Letter: H
Question
Here is a question about numerical computing, more specifially about solving nonlinear equations. PLEASE USE MATLAB if it requires to sketch functions, and please include MATLAB code screenshots in your answer!!! Also the explanations need to be at least one or two paragraghs and also the answer needs to have a summary too.
it may take a relative long time to get the results, and I would pretty appreciate your answers!!!!
1. In the derivation of Newton’s method, to determine the formula for xi+1, the function f(x) is approximated using a first-order Taylor approximation
centered at xi. This problem investigates what happens when you try to use a second-order Taylor approximation.
(a) Approximating f(x) using a second-order Taylor approximation centered at xi, what is the resulting formula for xi+1? Note your formula will have a ± in it.
(b) In theory, a second-order Taylor approximation should be more accurate than a first-order Taylor approximation (at least when you are close to
the solution). However, the formula in part (a) has several unpleasant complications that Newton’s method doesn’t have. Identify two of them.
(c) Given that xi+1 is close to xi, what choice should be made for the ± in part (a)?
(d) One way to avoid the complications considered in part (b) is to note that the Taylor approximation used in part (a) contains a term of the form (xi+1 xi)2. Explain why this can be approximated with (xi+1 xi)*f(xi)/f(xi). If this is done, what is the resulting formula for xi+1? Note that the formula you are deriving is known as Halley’s method, and it is an example of a third-order method.
Explanation / Answer
Linear Approximations We have already seen how to approximate a function using its tangent line. This was the key idea in Euler’s method. If we know the function value at some point (say f (a)) and the value of the derivative at the same point (f (a)) we can use these to find the tangent line, and then use the tangent line to approximate f (x) for other points x. Of course, this approximation will only be good when x is relatively near a. The tangent line approximation of f (x) for x near a is called the first degree Taylor Polynomial of f (x) and is: f (x) f (a) + f (a)(x a) x f(x) For example, we can approximate the value of sin(x) for values of x near zero, using the fact that we know sin 0 = 0, the derivative of d dx sin(x) = cos(x) and cos(0) = 1 sin(.02) sin 0 + cos 0(.02 0) = 0 + 1(.02) = +.02 This may seem like a useless idea. After all, your calculator will give you an exact(??) value of sin x for any x you choose. But, did you ever wonder how your calculator knew all those numbers? It hasn’t remembered them all, rather it remembers a polynomial approximation for sin x
same derivative at that point a and also the same second derivative there. We do both at once and define the second degree Taylor Polynomial for f (x) near the point x = a. f (x) P2 (x) = f (a) + f (a)(x a) + f (a) 2 (x a) 2
P2 (x) has the same first and second derivative that f (x) does at the point x = a.
Higher Order Taylor Polynomials We get better and better polynomial approximations by using more derivatives, and getting higher degreed polynomials. The Taylor Polynomial of Degree n, for x near a is given by: Pn (x) = f (a) + f (a)(x a) + f (a) 2 (x a) 2 + f (a) 3 2 (x a) 3 + f (4) (a) 4 3 2 (x a) 4 +···+ f (n) (a)(x a)n n(n 1)(n 2)··· 3 2 The terms in the denominators may be a bit surprising at first. In class we will calculate the first through nth derivatives of f (x) and its Taylor Polynomial Pn (x) to see that they (the derivatives) are the same. Returning to our example, the second degree Taylor Polynomial for sin x near 0 is P2 (x) = sin 0 + cos 0(x 0) sin 0 2 (x 0) 2 = 0 + 1(x) + 0 It is rather disappointing that this turns out to be no different from P1 for sin x. The third degree Taylor Polynomial for sin x near 0 is P3 (x) = sin 0 + cos 0(x 0) sin 0 2 (x 0) 2 cos x 3 2 (x 0) 3 = 0 + 1(x) 0 2 x2 1 3 2 x3 Check the value of P3 (.02) compared to what your calculator gives you for sin .02.
It is helpful to introduce some notation at this point. We have already introduced a new notation for higher order derivatives. That is, we are using the symbol f (i) (a) to mean the ith derivative of the f (x) evaluated at the point a. The factorial notation n! = n(n 1)(n 2)··· 3 2 1 is useful for the denominators of each term in the Taylor Polynomial. The summation notation, shown below, lets us write the Taylor Polynomial more succinctly. 5 i=1 g (i) = g (1) + g (2) + g (3) + g (4) + g (5) Using these notations we write the nth degree Taylor Polynomial for f (x) near 0 as: f (x) Pn (x) = n i=0 f (i) (0) i! (x 0) i
The 8th Taylor Polynomial for ex for x near a = 0: ex P8 = 1 + x + x2 2! + x3 3! +···+ x8 8! The nth Taylor Polynomial for sin x for x near a = 0. First calculate the derivatives of sin x! You should find a pattern that makes this easy. derivative at x = 0 f (x) = sin x is 0 f (x) = cos x is 1 f (x) = f (3) (x) = f (4) (x) = f (5) (x) = f (6) (x) = Now put it together: sin x Pn (x) = 0 + x + 0 2 x2 + 1 3! x3 + 0 4! x4 + 1 5! x5 +··· The nth Taylor Polynomial for cos x for x near a = 0: First calculate the derivatives, again, you should find a pattern that makes this easy. derivative at x = 0 f (x) = cos x is 1 f (x) = sin x is 0 f (x) = f (3) (x) = f (4) (x) = f (5) (x) = f (6) (x) = Now put it together: cos x Pn(x) = 4.6
In order to use an approximation method intelligently, we need to have an idea of how good our approximation is. That is, how big an error could we be making. The error is the difference between the approximation value and the exact answer. Notice, that we cannot know exactly how far off we are (how big the error is), without know the exact answer in the first place! When using the nth degree Taylor Polynomial Pn (x) centered at a to approximate f (x) the error is: E = f (x) Pn (x) If E > 0 that means that our approximation is bigger than the true value. If E < 0 then our approximation is too large. Often we are only interested (or can only find) the magnitude of the error |E|. It turns out that there is a simple formula which gives us a bound on the size of the error E. Again, this is only a bound on the size of the error and does not tell us the exact error (why??). This bound is called the remainder formula and is: |Rn| = f (n+1) (c) (n + 1)! (x a) n+1 where c is between a and x. This formula looks pretty similar to the next term of the Taylor Polynomial itself. The only difference is the c sitting in it. This stands for some value between a and x AND WE DON’T KNOW WHICH! You are probably worrying how on earth we can use this formula to get actual numbers if we don’t know what c is. Good question. What we need to do is look at all the values of f (n+1) (c) (for all a < c < x) and use the largest of them. Or, pick something that we know is surely larger than all of them. Example 1: Give a bound on the error for when e.5 is approximated by the fourth degree Taylor Polynomial of ex centered at 0.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.