Numerical Integration

1. May 17, 2008

loupblanc

There isn't an applied mathematics thread so i'll post this here.

I'm an undergraduate and I have a presentation for my numerical methods/matlab class . I'm looking for examples of
1)Integrals which are easier/faster to integrate numerically than do evaluate using their antiderivatives. (power series etc)
2)Integrals whose antiderivatives are not elementary functions on a bounded interval without ''smoothness'' problems on bounds, and if possible with a known integral value.

Thank you.

2. May 17, 2008

csprof2000

... correct me if I'm wrong, but aren't most integrals easier to evaluate numerically? Being able to find an antiderivative for a general function is supposed to be tricky.

I mean, but a fraction bar in there, add some exponentiation to algebraic functions of x, throw in some discontinuous functions and you should be good to go. As an example,...

[x^2e^sqrt(x+sin(x))]/(sinh x + cos x + x^x)

If that has an elementary function as its antiderivative, I'm retiring.

Or are you asking for useful examples?

3. May 17, 2008

loupblanc

Sorry, i wasn't clear.

By easier i meant that matlab would take less time/ computer memory to evaluate the integral using a numerical integration method ( Simpson, Romberg, etc) than evaluating the antiderative itself which is usually quite complicated ( expressed using power series, etc). I've read about this in articles but i've never seen an example.

Yeah, i'm looking for useful examples; like we know that integral of exp(-x^2) from -infinity to +infinity is root of phi, so i was wondering if there were integrals without antiderivatives like this on a bounded interval so that i could evaluate it using of the numerical integration methods for a presentation.

4. May 17, 2008

DavidWhitbeck

Well actually software such as mathematica, maple and perhaps even matlab do not use the elementary algorithms that we learn in high school calculus.

You are actually asking two different questions-- one question is what class of functions would be easier to integrate numerically using elementary methods, and the other question is what class of functions would be easier to integrate numerically if using sophisticated mathematical software.

For the latter, I think it's easier to just try and see. If you do it symbolically and it chokes, do it numerically instead. You would be amazed how many crazy integrals a program that Mathematica can handle! But still my experience is that the type of integrals that show up in research are not the kind that have analytic expressions that Mathematica can find.

5. May 17, 2008

loupblanc

My bad, i assumed that mathematical software uses elementary methods. Out of curiosity i'd like to know what methods they use.

But more importantly i'm searching for functions belonging to the former class i.e. easier to integrate numerically using elementary methods, as an example to add to my class presentation.To me at least, it's counterintuitive that numerical integration works better.

6. May 17, 2008

DavidWhitbeck

What about $$\int_{-1}^{1}\sin{(1/x)}dx$$?

It has an essential discontinuity which should (I hope) make evaluating the integral by series expansion tricky (and I believe also the anti-derivative is non-elementary)... but it can be handled numerically by splitting up the integral by

$$\int_{-\epsilon}^{\+\epsilon}f + \int_{[-1,1]\backslash [-\epsilon,+\epsilon]} f$$

where you show that the first part vanishes in the limit as $$\epsilon \rightarrow 0$$ and the other part can be done using numerical methods, and so evaluating the right hand side for non-zero but small $$\epsilon$$ should yield a good approximation to the integral.

7. May 17, 2008

George Jones

Staff Emeritus
Too easy.

$\sin \left(1/x \right)$ goes wonky at $x=0$, so

$$\int_{-1}^{1} \sin \left( \frac{1}{x} \right)dx$$

is an improper integral, and

$$\int_{-1}^{1} \sin \left( \frac{1}{x} \right)dx = \lim_{\epsilon \rightarrow 0} \left( \int_{-1}^{ - \epsilon} \sin \left( \frac{1}{x} \right) dx + \int_{\epsilon}^{1} \sin \left( \frac{1}{x} \right) dx \right) = 0 ,$$

since $\sin( \left(1/x \right)$ is an odd function.

I don't know whether

$$\int_{0}^{1} \sin \left( \frac{1}{x} \right)dx$$

meets the original poster's criteria, but it is an interesting integral.

The substitution $w = 1/x$ followed by an integration by parts turns this integral into the special function $ci \left( x \right)$.

Last edited: May 17, 2008
8. May 17, 2008

Crosson

Doing definite integrals with numerical integration is typically 1000s of times faster than with symbolic integration (anti-derivatives). It would be more notable to find an integralwhich can be done very simply using anti-derivatives but will choke most numerical integration algorithms.

The following description of the implementation of the symbolic integrator in Mathematica is taken from the Wolfram Inc website:

* For indefinite integrals, an extended version of the Risch algorithm is used whenever both the integrand and integral can be expressed in terms of elementary functions, exponential integral functions, polylogarithms and other related functions.

* For other indefinite integrals, heuristic simplification followed by pattern matching is used.

* The algorithms in Mathematica cover all of the indefinite integrals in standard reference books such as Gradshteyn-Ryzhik.

* Definite integrals that involve no singularities are mostly done by taking limits of the indefinite integrals.

* Many other definite integrals are done using Marichev-Adamchik Mellin transform methods. The results are often initially expressed in terms of Meijer G functions, which are converted into hypergeometric functions using Slater's Theorem and then simplified.

* Integrals over multidimensional regions defined by inequalities are computed by iterative decomposition into disjoint cylindrical or triangular cells.

* Integrate uses about 500 pages of Mathematica code and 600 pages of C code.

9. May 17, 2008

DavidWhitbeck

Oh woops yeah George, that was dumb of me to claim an odd integral over [-1,1] was hard when it's obviously 0! lol

10. May 17, 2008

loupblanc

Yes, i'm looking for functions like the one David and George proposed, but which are defined on the bounds of the integral. I doubt ci(x) can be integrated properly with elementary methods, since it wobbles so much near zero.

@ Crosson : wow,now i see how advanced the maths is to integrate symbolically with math software. But I'm searching for cases where even though we know what the antiderivative is, it is still faster to integrate numerically than to evaluate the antiderivative.

11. May 18, 2008

csprof2000

Perhaps some massively piecewise function would work. I mean, in the limit, it would be doing the same thing as numerical integration, and it would have the extra work of doing the antiderivative in the first place.