How Can I Perform Double Numerical Integration in MATLAB or Mathematica?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 4K views
EngWiPy
Messages
1,361
Reaction score
61
I have the pdf of a random variable found from the characteristic function given by

[tex]f_X(\alpha)=\frac{1}{2\pi}\sum_{m=0}^Mj^m{K\choose m}\int_0^{\infty}e^{-jt(m+\alpha)}E_1^m(-jt)\,dt[/tex]

where ##j=\sqrt{-1}## and ##E_1(x)## is the exponential integral. I need to find the CDF of the random variable ##X## which is given by

[tex]F_X(x)=\int_0^xf_X(\alpha)\,d\alpha[/tex]

I can interchange the integrals, but I ended with two numerical integrations as well.

How can I do this in MATLAB? Is it easier to do in Mathematica?
 
on Phys.org
First, how can I evaluate ##
\int_0^{\infty}e^{-jt(m+\alpha)}E_1^m(-jt)\,dt
## numerically in MATLAB? Previously I used Mathematica because I felt it is easier to use for numerical integration, but now I have access to MATLAB only. Note that the result will be a function of ##\alpha## and not a number.
 
If you want the result in terms of alpha and not a number, then you want to do symbolic integration not numerical integration (the latter uses quadrature methods and produces a number).

Check out the int function in Symbolic Math Toolbox. You'll also need to use the expint function to form the integrand.
 
  • Like
Likes   Reactions: EngWiPy
kreil said:
If you want the result in terms of alpha and not a number, then you want to do symbolic integration not numerical integration (the latter uses quadrature methods and produces a number).

Check out the int function in Symbolic Math Toolbox. You'll also need to use the expint function to form the integrand.

OK, so, it's possible. I thought numerical integrations result only in numbers. I will check that out. Thanks