MATH 661.FA21 Final Examination

Instructions. Solve the problems for your course track. Formulate your answers clearly and cogently. Sketch out an approach on scratch paper first. Concisely transcribe the approach to the answer you turn in, followed by appropriate calculations and conclusions, within allotted time. Use concise, complete English sentences in the description of your approach. Each question is meant to be completely answered and transcribed from proof to final copy within thirty minutes. Concentrate foremost on clear exposition of the concept underlying your approach. Sign each page thus acknowledging honor code rules. Do not turn in scratch work.

Preamble. The course objectives set out in the syllabus are reproduced below, along with a formulary. Problems probe understanding of the course concepts, rather than rote memorization.

“There are just four mathematics ideas that are considered in this course:

Approximation

The notion of replacing some complicated mathematical object by one that is simpler to compute. In succession, the course presents the approximation of numbers, functions, and operators. The main focus is on numerical approximation, but computational analytical approximation is also presented.

Linear combination

An approach to constructing complex objects by scaling and addition of simpler objects. Note the link to approximation, in that “simpler to compute” is interpreted as scaling and addition.

Nonlinear combination

An approach to constructing complex objects by function composition, successive nonlinear transformation of simpler objects.

Limits

An approach to constructing complex objects by a sequence of approximations.

Comparable simplicity is encountered in computational ideas:

Memory management

Transfer and organization of data on a computer.

Repetition

Multiple execution of a task. Two repetition types are encountered:

Iteration

A portion of code that is repeatedly executed, typically within a loop.

Recursion

A portion of code organized as a function that calls itself.

Condition testing

Carrying out decisions based on data.”

Formulary. Newton method to solve f(x)=0: xn+1=xn-f(xn)/f'(xn).

Newton form of interpolating polynomial: pn(t)=[y0]+[y1,y0](t-x0)++[yn,,y0](t-x0)...(t-xn-1)

Divided differences: [yk]=yk, [yk+m,...,yk]=([yk+m,...,yk+1]-[yk+m-1,...,yk])/(xk+m-xk)

Finite difference operators: Ekf(x)=f(x+kh), Δf(x)=(E-I)f(x), f(x)=(I-E-1)f(x), δf(x)=(E1/2-E-1/2)f(x)

Binomial expansion: (x+y)n=k=0n( n k )xn-kyk, ( n k )=, n

Generalized binomial expansion: (x+y)α=k=0( α k )xα-kyk, α

Interpolation operator: xk=x0+kh, pn(x0+αh)=(I+)ay0

Householder reflector 𝑯=𝑰-2

1Track 1

  1. Newton's method to solve f(x)=0, uses data 𝒟n={(xn,fn,fn')} to construct a linear approximant g, and the next iterate xn+1 is the solution of g(x)=0. Construct an analogous method based upon data 𝒟={(xn-1,fn-1),(xn,fn,fn')}, and establish its order of convergence (fn=f(xn), fn'=f'(xn)).

    Solution. Since three conditions are specified, the interpolating polynomial is quadratic, of form

    p(t)=[fn-1]+[fn,fn-1](t-xn-1)+[fn,fn,fn-1](t-xn-1)(t-xn),

    with [fn,fn]=fn'. Divided difference table

    i xi [fi] [fi,fi-1] [fi,fi-1,fi-1] n-1 xn-1 fn-1 - - n xn fn - n xn fn fn'

    Interpolating polynomial

    p(t)=fn-1+fn-fn-1xn-xn-1(t-xn-1)+fn'(xn-xn-1)-(fn-fn-1)(xn-xn-1)2(t-xn-1)(t-xn).

    Solve p(t)=0

    at2+bt+c=0,
    a=fn'(xn-xn-1)-(fn-fn-1)(xn-xn-1)2,b=d-a(xn-1+xn),d=fn-fn-1xn-xn-1,
    c=fn-1-xn-1d+xn-1xna,
    t1,2=-b±b2-4ac2a

    Chose xn+1 the root closer to xn. Since the interpolation is quadratic, expected order of convergence is cubic.

  2. Present a pseudo-algorithm code to compute xn=p+xn-1 for n>1, n, x1=p. Express the limit x=limnxn in terms of p>0.

    Solution.

    Algorithm

    Input: n,p

    x=p

    forj=2 to n

    x=p+x

    return x

    At the limit x iteration does not change the value, i.e., x is a fixed point. Solve

    x=p+xx=12(1+1+4p)toensurex>0.
  3. Find a quadrature formula

    -11f(x)dxc(f(x0)+f(x1)+f(x2))

    that is exact for all quadratic polynomials.

    Solution. Apply moment of methods to obtain system

    -111dx=2=3cc=23
    -11xdx=0=c(x0+x1+x2)
    -11x2dx=23=c(x02+x12+x22)

    Three conditions for four unknowns c,x0,x1,x2, one arbitrary degree of freedom. Can impose, e.g.,

    -11x3dx=0=c(x03+x13+x23).

    Symmetry suggests x2=-x0, x1=0, in which formula is exact for cubics also, and

    c=23,x0=-12,x1=0,x2=12.
  4. Determine A,B such that

    yn+1=yn+h(Afn+Bfn+1),

    is a consistent scheme to solve the ordinary differential equation y'=f(y).

    Solution. Replace yn+1=y(xn+h), fn+1=f(y(xn+1)), and carry out Taylor series expansions

    f(yn+1)=f(yn)+f'(yn)(yn+1-yn)+=f(yn)+f'(yn)(hy'(xn)++)
    y(xn)+y'(xn)h+y''(xn)h22+=y(xn)+h(Af(yn)+B[f(yn)+hf'(yn)y'(xn)+])

    Gather terms, identify powers of h, coefficients are

    𝒪(h0) 0 𝒪(h) y'(xn)-(A+B)f(yn) 𝒪(h2) 12y''(xn)-Bf'(yn)y'(xn)

    Since y'(xn)=f(yn) the condition

    A+B=1

    is required for consistency, satisfied, e.g., by A=1, B=0 by forward Euler, A=0, B=1 by backward Euler.

  5. Determine a,b,c,d,e such that

    f(x)={ a(x-2)2+b(x-1)3 x(-,1] c(x-2)2 x[1,3] d(x-2)2+e(x-3)3 x[3,) ,.

    is a cubic spline.

    Solution. Impose continuity of function, derivatives at knots

    atx=1:a=c(repeated3times)
    atx=3:c=d(repeated3times),

    hence a=c=d, b,e determined from arbitrary end conditions.

2Track 2

  1. Formulate and analyze algorithms for finding roots of f(x)=0, f:[0,2π], fL2(), based upon approximation of f within span(𝒯), 𝒯={1,cost,sint,cos2t,sin2t,...}.

    Solution. The approximant is a linear combination of functions in 𝒯

    g(t)=a0+a1cost+b1sint+=k=0akcos(kt)+k=1bksin(kt)

    Construct algorithms by analogy to the monomial basis {1,t,t2,}, where secant, Newton are obtained as truncations to span{1,t}, over an interval [xn-1,xn] with endpoints from a root approximation sequence {xn}n. Hence consider approximant of form

    g(t)=a0+a1cost+b1sint,

    and data 𝒟={(xn-k,fn-k),k=0,1,2}, sorted such that xn-2xn-1xn, and coefficients from solution of

    [ 1 costn-2 sintn-2 1 costn-1 sintn-1 1 costn sintn ][ a0 a1 b1 ]=[ fn-2 fn-1 fn ].

    The next iterate xn+1 is set as the root of the approximant

    g(xn+1)=a0+a1cosxn+1+b1sinxn+1=0,

    solvable at the cost of an arctangent evaluation. Algorithm analysis seeks order of convergence of error

    en+1=xn+1-x,

    which requires (complicated) Taylor series expansions, but order of convergence should at least equal that of the secant method (superlinear).

  2. Present a recursive pseudo-code algorithm to compute to within relative error ε

    I(f)=abf(t)dt,

    by applying on subintervals the Gauss-Legendre quadrature

    -11f(t)dtf(-1/3)+f(1/3).

    Solution. From H09

    Algorithm

    Recursive quadrature

    RecInt(a,b,err,f,Q)

    c=a+(b-a)/2

    Qab=Q(f,a,b);Qac=Q(f,a,c);Qcb=Q(f,c,b)

    e=|Qac+Qcb-Qab|/|Qac+Qcb|

    if e<err

    return Qac+Qcb

    else

    return RecInt(a,c,err,f,Q)+RecInt(c,b,err,f,Q)

    Map [-1,1] to [a,b] through s(t)=(b-a)(t+1)/2+a, ds=(b-a)/2dt, hence

    Q(f,a,b)=2b-a[f(s1)+f(s2)]

    with

    s1,2=(b-a)(±13+1)/2+a.

  3. Differentiation of the interpolation operator

    dpn(x)dx=ddx(I+Δ)αy0=1hddα(I+Δ)αy0=1hlog(I+Δ)(I+Δ)αy0=1hlog(I+Δ)pn(x),

    allows identification of the differentiation operator as a forward difference series

    ddx=1hlog(I+Δ)=1h(Δ-Δ22+Δ33-+).

    Find an analogous expression for the integration operator

    dx,

    and analyze the resulting quadrature formulas.

    Solution. Numerical quadrature formulas are obtained by replacing the integrand with an approximation, in this case a polynomial based upon data set 𝒟={(xi=x0+ih,yi=f(xi)),i=0,..,n},

    abf(x)dx=x0xnpn(x)dx.

    Formal operator integration gives

    x0xnpn(x)dx=x0xn(I+Δ)αy0dx=[h0n(I+Δ)αdα]y0=h[(I+Δ)n-Ilog(I+Δ)]y0.

    Carry out series expansions

    1log(1+s)=s-1+12-s12+s224-
    (1+s)n-1=ns+n(n-1)2s2++sn
    (1+s)n-1log(1+s)=(s-1+12-s12+s224-)(ns+n(n-1)2!s2+n(n-1)(n-2)3!s3++sn)=
    n(1+s2-s212+)(1+n-12s+(n-1)(n-2)6s2+)=
    n(1+n2s+n(2n-3)12s2+).

    The above leads to

    x0xnpn(x)dx=nh(I+n2Δ+n(2n-3)12Δ2+)y0.

    Analyze truncations of the above operator series. Newton-Cotes type formulas are obtained by choosing evaluation points within the integration domain of length L=xn-x0=nh

    n=1.

    𝒪(Δ0):x0x1f(x)dxx0x1pn(x)dxnhIy0=Ly0(rectanglerule,error𝒪(h))
    𝒪(Δ1):x0x1f(x)dxx0x1p1(x)dxh(I+12Δ)=Ly0+y12(trapezoidrule,error𝒪(h2))
    𝒪(Δ2):x0x2f(x)dxx0x2p2(x)dx2h(I+12Δ+16Δ2)=L6(y0+4y1+y2)(Simpsonrule,error𝒪(h4))
  4. Construct a Gauss quadrature for integrals of form

    01e-t𝑯𝒇(t)dt,

    that is exact for cubic 𝒇(t), where 𝑯m×m is a Householder reflector.

    Solution. In the series

    e-t𝑯=𝑰-t𝑯+t22!𝑯2-t33!𝑯3+,

    note that 𝑯2=𝑰, i.e., reflection of a reflection is the original vector, verified algebraically by

    𝑯2=(𝑰-2)(𝑰-2)=𝑰-4+4=𝑰,

    hence

    e-t𝑯=(1+t22!+t44!+)𝑰-(t+t33!+t55!+)𝑯=cosht𝑰-sinht𝑯.

    The integral becomes

    01e-t𝑯𝒇(t)dt=01(cosht𝑰-sinht𝑯)𝒇(t)dt=01cosht𝒇(t)dt-𝑯01sinht𝒇(t)dt.

    The integrals are approximated by Gauss quadrature

    01sinhtfi(t)dtu0fi(x0)+u1fi(x1),01coshtfi(t)dtv0fi(y0)+v1fi(y1),

    using the orthogonal polynomial family {φ0,φ1,φ2} with respect to scalar product

    (f,g)=01coshtf(t)g(t)dt.

    The sample points x0,x1 (nodes) are roots of φ2, and weights w0,w1 are found by method of moments. Analogous for the sinh integral.

  5. Construct a second-order accurate scheme to solve the integro-differential equation

    my''+cy'+ky=0tR(t-τ)y(τ)dτ,

    that describes the motion of a point mass m subject to drag -cv=-cy', elastic force -ky, and internal relaxation Ry, starting from initial conditions y(0)=y0, y'(0)=v0.

    Solution. At ti=ih, a centered second-order discretization of the differential operator is

    (my''+cy'+ky)imyi+1-2yi+yi-1h2+cyi+1-yi-12h+kyi

    A second-order approximation of the integral operator is given by the composite trapezoid rule

    0tiR(ti-τ)y(τ)dτ=j=1itj-1tjR(ti-τ)y(τ)dτ=h2j=1i[Ri-jyj+Ri-j+1yj-1]=Si,

    with Rk=R(kh). From y'(0)=v0, approximate by y1=y0+hv0, establishing initial values to advance the iteration

    yi+1=2yi-yi-1+h2m[Si-cyi+1-yi-12h-kyi],i=1,2,