#### Question Details

(Solved) Question 1 (a) Find an exact formula for the cubic polynomial

Question 1 (a) Find an exact formula for the cubic polynomial P3(x) =

x3 + ? ? ? such that

Math 128A, Spring 2016

Problem Set 07

Question 1 (a) Find an exact formula for the cubic polynomial P3 (x) =

x3 + ? ? ? such that

Z 1

P3 (x)q(x)dx = 0

1

for any quadratic polynomial q.

(b) Find exact formulas for the three roots x1 , x2 , x3 of the equation

P3 (x) = 0.

(c) Find exact formulas for the integration weights w1 , w2 , w3 such that

Z 1

1

q(x)dx =

3

X

wj q(xj )

j=1

exactly whenever q is a polynomial of degree 5.

(d) Given any real numbers a < b, ?nd exact formulas for points yj 2 [a, b]

and weights uj > 0 such that

Z b

a

q(x)dx =

3

X

uj q(yj )

j=1

whenever q is a polynomial of degree 5.

(e) Explain why each of the three factors in the error estimate

Z b

a

f (x)dx

3

X

uj f (yj ) = C6 f

(6)

(?)

j=1

Z b

a

(y

y1 )2 (y

y2 )2 (y

y3 )2 dy

is inevitable and determine the exact value of the constant C6 .

(f) Use your code from Question 2 to evaluate

E6 =

Z 1

0

(x

x1 )2 (x

x2 )2 (x

x3 )2 dx

to 3-digit accuracy.

Question 2 (a) Write, test and debug an adaptive 3-point Gaussian integration code gadap.m of the form

function [int, abt] = gadap(a, b, f, p, tol)

% a,b: interval endpoints with a < b

% f: function handle f(x, p) to integrate (p for user parameters)

% tol: User-provided tolerance for integral accuracy

% int: Approximation to the integral

% abt: Endpoints and approximations

1

Math 128A, Spring 2016

Problem Set 07

Build a list abt = {[a1 , b1 , t1 ], . . . , [an , bn , tn ]} of n intervals [aj , bj ] and apRb

proximate integrals tj ? ajj f (x)dx, computed with 3-point Gaussian integration. Initialize with n = 1 and [a1 , b1 ] = [a, b]. At each step j = 1, 2, . . .,

subdivide interval j into into left and right half-intervals l and r, and approximate the integrals tl and tr over each half-interval by 3-point Gaussian

quadrature. If

|tj

(tl + tr )| > tol max(|tj |, |tl | + |tr |)

add the half-intervals l and r and approximations tl and tr to the list. Otherwise, increment int by tj . Guard against in?nite loops and ?oating-point

issues as you see ?t and brie?y justify your design decisions in comments.

R

(b) Approximate the integral 01 x x dx using your code from (a). Measure

the total number of function evaluations required to obtain 12-digit accuracy.

Plot the accepted intervals. Compare your results with those obtained in the

previous problem set by Romberg integration.

2

**Solution details:**

Answered

QUALITY

Approved

ANSWER RATING

This question was answered on: * Oct 15, 2019 *

##### Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .

#### About this Question

STATUSAnswered

QUALITYApproved

DATE ANSWEREDOct 15, 2019

EXPERTTutor

ANSWER RATING

#### YES, THIS IS LEGAL

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

- As a reference for in-depth understanding of the subject.
- As a source of ideas / reasoning for your own research (if properly referenced)
- For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).

#### NEW ASSIGNMENT HELP?

### Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions.
New orders are original solutions *and precise to your writing instruction requirements. Place a New Order using the button below.*

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN A DEADLINE.