- #1
ILens
- 12
- 0
Hello!
I have the following problem: I cannot solve the integral below by the means of Matlab.
it gives me the output
I managed to calculate the integral by the means of both Mathcad and Mathematica. Mathcad gave 0.088 as an answer (I had to explicitly specify "Infinite Limit" as a method). Mathematica gave me 0.0880741, I used the NIntegrate function:
Does anyone have an idea, how I can solve this integral in Matlab? What do Mathcad and Mathematica use in order to solve it?
Thanks!
I have the following problem: I cannot solve the integral below by the means of Matlab.
[tex]
\int_{-\infty}^{\infty} \frac{e^{-t^2}}{\left(2-t\right)^2 + 16} dt
[/tex]
When I write the following in Matlab\int_{-\infty}^{\infty} \frac{e^{-t^2}}{\left(2-t\right)^2 + 16} dt
[/tex]
Code:
>> syms t;
>> y = exp(-t^2) / (16 + (2 - t)^2);
>> int(y, t, -inf, inf)
Code:
Warning: Explicit integral could not be found.
> In sym.int at 58
ans =
int(exp(-t^2)/(16+(2-t)^2),t = -Inf .. Inf)
I managed to calculate the integral by the means of both Mathcad and Mathematica. Mathcad gave 0.088 as an answer (I had to explicitly specify "Infinite Limit" as a method). Mathematica gave me 0.0880741, I used the NIntegrate function:
[tex]
\mbox{NIntegrate}\left[\frac{e^{-t^2}}{\left(2-t\right)^2 + 16}, \left\{t, -\infty, \infty \right\} \right]
[/tex]
\mbox{NIntegrate}\left[\frac{e^{-t^2}}{\left(2-t\right)^2 + 16}, \left\{t, -\infty, \infty \right\} \right]
[/tex]
Does anyone have an idea, how I can solve this integral in Matlab? What do Mathcad and Mathematica use in order to solve it?
Thanks!