MATH3242/COSC3122

FW03

SOLUTIONS TO TERM TEST 2

Wednesday, March 17, 2004

1. (7 marks) Put the following integrals into the standard form for the type of Gaussian integration indicated.

(a) Gauss-Legendre:

Let x = at + b and choose a and b so that t = 1 when x = 3 and t = -1 when x = -1. this gives x = 2t + 1, dx = 2dt and the integral becomes

(b) Gauss-Laguerre:

Let 5u = t + b and choose b so that t = 0 when u = 5. This gives 5u = t + 25, 5du = dt and the integral becomes

2. (4 marks) For what values of the parameter q do the following integrals converge?

(a)

Since sin(x) = x + O(x3) the integrand behaves as xq-3 near the origin. For this to be integrable q - 3 > -1 or q > 2.

(b)

The integrand behaves as e(4-q)x at infinity. For this to be integrable, 4 - q < 0 or q > 4.

3. (12 marks) Evaluate the improper integral by integrating the singular part analytically and using the Elementary Trapezoidal Rule for the remainder.

Since the error term in the Elementary Trapezoidal Rule involves the second derivative of the integrand, we must have n > 2 + 3/2 -1. Thus take n = 3. Now

ln(1 + x) = x -x2/2 + x3/3 + O(x4) = P3(x) + O(x4).

Thus the integral can be written as

The first integral can be done analytically to yield [2x1/2 - x3/2/3 + 2x5/2/15|01 = 27/15

We use the Elementary trapeziodal Rule with h = 1 to evaluate the second integral. Since the integrand is zero at x = 0 since it behaves as x4-3/2 there this yields [ln(2) - 5/6]/2 = -0.0701. Thus the original integral has the approximaate value 27/15 - 0.0701 = 1.7299

4. (4 marks) Which of the following initial-value problems satisfy the conditions which guarantee a unique solution? Justify your answer.

(a) y´ = 2y/x2 + x2, 1 £ x £ 2, y(1) = 4;

The rhs of the DE is continuous on the domain D and its partial derivative wrt y is 2/x2 which is less than 2 on the interval 1 £ x £ 2. Thus it satisfies a Lipschitz condition and a unique solution is guaranteed.

(b) y´ = x sin(y) + tan(x), 0 £ x £ 2, y(0) = –2

The rhs of the DE is not continuous at pi/2. Thus a unique solution is not satisfied.

5. (3 marks)

(a) Transform the second-order initial-value problem

y´´ - 2x2y´ + 4y2 = x2, 0 £ x £ 1, y(0) = 1.4, y´(0) = 0.6

into a system of first-order differential equations.

Let z = y´. Then the DE can be written as the system:

y´ = z; y(0) = 1.4

z´ = 2x2z - 4y2 + x2; z(0) = 0.6

6. (6 marks) Solve the initial-value problem given in question 4 (a) using the Runge-Kutta Midpoint Method. Take h = 1.0.

Here f(x, y) = 2y/x2 + x2, h = 1, k1 = f(xi, wi), k2 = hf(xi + h/2, wi + k1/2)

 xi wi k1 xi + h/2 wi + k1/2 k2 1. 4. 9. 1.5 8.5 9.8055 2. 13.8055

7. (5 marks) Write out the Taylor method of order two for the initial-value problem

y´ = xy + ex, -1 £ x £ 1, y(-1) = 2.4

Here f(x, y) = xy + ex, f´ = y + xy´ + ex = y + x(xy + ex) + ex

Thus the Taylor method of order two is

w0 = 2.4

wi+1 = wi + h[xiwi + exp(xi) + h/2((xi2+1)wi + (xi+1)wi)]

8. (5 marks)

(a) What is the largest degree polynomial whose integral is evaluated exactly using:

i) the Elementary Simpson's Rule? 3

ii) Gauss-Laguerre integration using 3 points? 5

(b) Give a brief description of the strategy used in the Runge-Kutta-Fehlberg method to control the error in the solution.

The error is estimated by calculating the next value using both a fourth- and fifth-order Runge-Kutta method. From these two values an estimate of the error can be made. The step size is then adjusted to ensure the error tolerance is met while taking the largest step possible.

(c) How are the roots in a Gaussian integration scheme determined?

They are the roots of the associated orthogonal polynomial.

2