MATH 417 Lecture 14

From Notes
Jump to navigation Jump to search

« previous | Thursday, February 27, 2014 | next »

End Exam 1 content


Exam Review

Section 2.1: Bisection

(#10) f(x)=(x+2)(x+1)2x(x1)3(x2)

Find root in [1.5,2.5]=[32,52] using bisection:

  1. f(-1.5) < 0
  2. f(2.5) > 0
  3. f(0.5) > 0
  4. f(-0.5) < 0
  5. f(0) = 0 ← stop


Section 2.2: Fixed Point

f(x)=x3x1=0 for x[1,2]

Find x=g(x) and take p0[a,b] and recursively find pn+1=g(pn) for n=0,1,2,


  1. for any x[a,b], we need g(x)[a,b]
  2. (maxx[a,b]|g(x)|=k)<1


|pnp|knmax(bp0,p0a)

|pnp|kn1k|p1p0|


In our case, we take x=x+13:

  1. 1<g(1)g(2)=313<2
  2. |g(x)|=131(x+1)2313223=k


Find the number of iterations needed to get accuracy 103:

|pnp|(13413)nmax(p01,2p0)

Choose p0=32, now

(3413)n12103(3413)n2103nln(3413)ln23ln10n3ln10ln2ln3+13ln4=9ln103ln23ln3+ln43.981909816

Therefore take n=4

Newton's Method

x=g(x), g(x)=xf(x)f(x)

If f is concave-up, choose right endpoint: Newton's method works best when f>0 and f>0

In our example above, pn+1=pnpn3pn13pn21


Chapter 3: Interpolation

Given x0,x1,xn, interpolate f(x) as a polynomial pn(x)


Lagrange

f(x)=i=1nf(xi)j=0;jin(xxj)(xixj)+f(n+1)(ξ)(n+1)!(xx0)(xx1)(xxn)error


Newton

f(x)=f(x0)+f[x0,x1](xx0)++f[x0,x1,,xn](xx0)(xxn)+f(n+1)(ξ)(n+1)!(xx0)(xx1)(xxn)error

Example: (9th ed: 124 #7): Find polynomial that interpolates at 0, 1, 2, 3 at the point x=52 (that is, find p0,1,2,3(52)) given:

  • p0,1(x)=2x+1 (the line through f(0) and f(1))
  • p0,2(x)=x+1 (the line through f(0) and f(2))
  • p1,2,3(52)=3 (the parabola through f(1), f(2), and f(3) has value 3 at x=52

We know the lines through f(0)

x   f(x)
--------
0    1
        2
1    3       -1
        0             (a-1)/6
2    3       (a-3)/2
        a-3
3    a


Now p1,2,3(x)=3+0(x1)+a32(x1)(x2), hence p1,2,3(52)=3=3+a32(32)(12) and a=3.


Therefore, our interpolating polynomial p0,1,2,3 is

p0,1,2,3(x)=3+13(x3)(x2)(x1)

and evaluated at x=52, we get p0,1,2,3(52)=238

Hermite

A tomato is launched at a height of 10 ft with an initial speed of 10 ft/s. The tomato hits a person standing 50 ft away and has a final speed of -20 ft/s

 x   f(x)  f'(x)
 0    10
            10
 0    10          -51/250
            -1/5           -12/3125
 50   0           -99/250
            -20
 50   0


H3(x)=10+10x51250x2123125x2(x50)

Whoa! The trajectory of an object is parabolic (disregarding friction or air resistance), and given only two points with derivatives (positions and velocities), we can reconstruct the entire trajectory exactly. The same can be done with three points, since three points uniquely defines a parabola.

Section 4.1: Differentiation

(9th ed. #22) Approximate f(x0) using f(x0h), f(x0), f(x0+h), f(x0+2h) to accuracy O(h3)


Taylor series around f(x0):

f(x0h)=f(x0)hf(x0)+h22f(x0)h36f(x0)+O(h4)f(x0+h)=f(x0)+hf(x0)+h22f(x0)+h36f(x0)+O(h4)f(x0+2h)=f(x0)+2hf(x0)+(2h)22f(x0)+(2h)36f(x0)+O(h4)

Multiply equations by A, B, and C, respectively and solve for:


Af(x0h)+Bf(x0+h)+Cf(x0+2h)=(A+B+C)f(x0)+h(A+B+2C)f(x0).

We get the following system of equations

{A+B+2C=1A+B+4C=0A+B+8C=0A,B,C=13,1,16


Alternatively, we can find P3(x0) via the interpolating polynomial above, but that usually involves more work.


Sections 4.3 and 4.7: Integration

(9th ed. #20)


01f(x)dx12f(x0)+c1f(x1)

Find the rule with best DAC (which will be the Gaussian rule since scaling factor is 1/2)

  1. 011dx=1=12+c1, so c1=12
  2. 01xdx=12=12x0+12x1
  3. 01x2dx=13=12x02+12x12

Solve for x0,x1=12±36.

Degree of accuracy is 221=3.

Note: Every Gaussian rule is symmetric


(9th ed. #13)

02f(x)dx4 by trapezoid and 2 by simpson's rule. Find f(1).


{22(f(0)+f(2))=426(f(0)+4f(1)+f(2))=24+4f(1)=6f(1)=12