3 Answers
3

Try not to supply machine numbers to integrals over infinite domains. They can cause errors that build up to the extent you have seen. Either compute the symbolic integral with exact numbers (and then convert it to a numeric value)

Just to contribute to the debate, here is some more evidence that supports the proposition that numerical error is the issue.

If we run the integral through various permutations of the ways of making exact and approximate calculations, the pattern I think suggests that numerical error is the reason the OP's integral is so far off.

The OP's result appears in the third row. Note that if the coefficients are entered with arbitrary precision instead of machine precision (row int[N[exact, 10]]), a warning of a total loss of precision is given. This is a hint that the machine precision calculation is probably wrong. Note also that the exact value of the integral symbolic /. sub converted to machine precision is far off the value when it is calculated with arbitrary precision. (We have to increase $MaxExtraPrecision to get an result with more than 0 digits of precision.)

If we bump up the precision enough, we can get an accurate result for the integral with arbitrary precision coefficients.

In sum, one can compute the integral with exact or approximate coefficients, but using approximate coefficients has the problem that enough precision is necessary to get an exact result. That machine precision works with NIntegrate is perhaps not a surprise (well, not to me). But why does N[int[exact]] (with the exact numerical coefficients) work but not the symbolic integral? I suspect it is because the form of the antiderivatives used are different, which changes the numerical computation. For instance, if we set L = 2 and leave the others coefficients symbolic, we get an antiderivative in terms of the error function Erf instead of the hypergeometric function Hypergeometric1F1.

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.