←to practical programming

Exercise "integration"

  1. (mandatory)

  2. (optional) Using the integrate.quad routine from integrate.cs implement the Bessel function (of the first kind) using its [integral representation]. Make plots, compare with your numpy/scipy routines.

  3. (optional) Improve the effectiveness of your error-function implementation by switching the integration limits from {0,x} to {x,∞} for, say, x>1. Check the number of integrand calls for the naive and the (probably) more effective implementation. Hint: positive infinity in Csharp is double.PositiveInfinity,

    double infin = double.PositiveInfinity;