Skip to main content

Exercises 16.5 Homework

1.

Write a script which, when given an integer \(n \ge 2\text{,}\) finds and displays the Gauss-Laguerre evaluation points and weights. This can be done by adapting the code in Example 16.4.1, similarly to exercises in Exercises 15.5. Note that the right-hand side of a system for weights will involve factorials; in Matlab they can be computed with factorial function, for example factorial(i-1).

2.

Apply the Gauss-Laguerre rule with \(n=5\) to the integral \(\int_{0}^\infty \exp(-x^2)\,dx\) whose exact value is \(\sqrt{\pi}/2\text{.}\) The script should display the approximation obtained, and the error (the absolute value of the difference between the approximate and exact values).