hello,(adsbygoogle = window.adsbygoogle || []).push({});

I have a problem with the use ofquadfunction in Matlab for numerical integration. Let me try to explain on an example. When I want to find the integral of expression exp(-x^2/2) from 0 to infinity, where for the higher bound I use some very large number:

Q = quad('exp(-x.^2./2)',0,10000000000)

I get the correct result sqrt(pi/2)=1.2533.

If I try to use the same logic for the expression x*exp(-x^2/2) for the same bounds:

Q = quad('x.*exp(-x.^2./2)',0,10000000000)

I get the result 0, although I know that correct result for this integral is 1.

What can potentialy be the problem? The thing is I am solving some more difficult integrals, without analytical solutions, but in some way similar to this example, and I always get 0 where I don't expect it using thequadfunction.

Thank you in advance...

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB - Numerical integration

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads for MATLAB Numerical integration | Date |
---|---|

I don't get a reasonable output for my code? | Mar 18, 2017 |

MATLAB Finite difference numerical integration or ode45? | May 17, 2016 |

MATLAB Numerical integration | May 7, 2016 |

Mathematica Numerical vs. Monte-Carlo Simulations | May 2, 2016 |

MATLAB Bisection method and numerical integration | Apr 14, 2016 |

**Physics Forums - The Fusion of Science and Community**