Integration with one variable and many constants

1 view (last 30 days)
Hello,
I have a problem where I would like to inegrate this function:
f(x) = exp(-g*(a-x)^2)./(((x-b).^2+c^2).*((x-d).^2+e^2));
where a,b,c,d,e,g are constants, and the variable is x.
My attempt was:
syms a b c d e g x real
f = exp(-g*(a-x)^2)/(((x-b)^2+c^2)*((x-d)^2+e^2)); Q = int(f,0,inf)
But it just returns:
Q =
int(exp(-g*(a - x)^2)/((c^2 + (b - x)^2)*(e^2 + (d - x)^2)), x, 0, Inf).
I don't know what I'm doing wrong, and whether or not my solution even converges or not, because I tried this with Mathematica and it doesn't give me an output either. I've even tried to modify the function to:
f = (a-x)*exp(-g*(a-x)^2)/(((x-b)^2+c^2)*((x-d)^2+e^2));
But even that doesn't work. Any help would be greatly appreciated.
  2 Comments
Abdurrahman M
Abdurrahman M on 20 Oct 2016
I have even tried this:
syms a b c d e g x real
f = @(x) (a-x)*exp(-g*(a-x)^2)/(((x-b)^2+c^2)*((x-d)^2+e^2)); Q = integral(f,0,inf)
But I get a lot of errors
Abdurrahman M
Abdurrahman M on 20 Oct 2016
I've simplified the function by putting in the constants:
f(x,y)=g(x)*exp(-1.02*(1-y)^2)/(((y-x)^2+1.05)*((y-x+3351)^2+0.0841))
In my case, g(x) is a two column vector.
Where I have to integrate with respect to x and y from 0 infinity.

Sign in to comment.

Accepted Answer

Mischa Kim
Mischa Kim on 20 Oct 2016
Abdurrahman, there is no closed-form solution that MATLAB (and Mathematica) can compute. That is why you get int() term as a result.
So in other words, you would have to integrate numerically and for that you need numeric values for your constants.
  1 Comment
Abdurrahman M
Abdurrahman M on 20 Oct 2016
The problem is that after I integrate with respect to x, I have to then integrate the resulting function with respect to y, of which the constants c(y) and d(y) are functions of, which I have not written explicitely.

Sign in to comment.

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!