explicit integral could not be found

1 view (last 30 days)
Peter
Peter on 15 Mar 2014
Commented: Roger Stafford on 16 Mar 2014
Hi,
I am trying to calculate some statistics using Matlab and I have almost completed it. All i need now is to calculate 1 number which will come from an integral. However the message Explicit integral cannot be found keeps coming up. here is my code:
syms x C;
double(int((x^1.7653)* ((1-x)^3.0546-1), x, C))
I have also used the same code but without the double() and still the same answer. Any help would be enormously appreciated. Thanks.

Answers (3)

Roger Stafford
Roger Stafford on 15 Mar 2014
In the integrand, do you mean
(x^1.7653)* ((1-x)^3.0546-1) (Case 1)
or do you mean
(x^1.7653)* (1-x)^(3.0546-1) ? (Case 2)
In either case, matlab can give you the numerical value of the integral directly using its 'betacdf' function in the Statistics Toolbox. As you have seen, the 'int' function is unable to supply an explicit expression. That can easily happen.
It isn't clear what your integration limits are. I will suppose you want to integrate from x = 0 to x = c for some arbitrary parameter c with 0<=c<=1.
In Case 1 the integrand can be expressed as:
x^1.7653*(1-x)^3.0546 - x^1.7653
and its integral would be
gamma(a)*gamma(b)/gamma(a+b)*betacdf(c,a,b) - c^a/a
where a = 1.7653+1 and b = 3.0546+1.
In Case 2 its integral is:
gamma(a)*gamma(b)/gamma(a+b)*betacdf(c,a,b)
where a = 1.7653+1 and b = 3.0546.
If your integration limits are different from the above, the above can easily be modified to give the correct answer. Just let us know what those limits actually are.

Walter Roberson
Walter Roberson on 15 Mar 2014
Edited: Walter Roberson on 15 Mar 2014
Are you intending to integrate over x = x to C ? Your form is a bit ambiguous about the limits.
Even without that you simply have the problem that it is difficult to find a closed form solution for the integral.
Perhaps it would be within your accuracy requirements to convert the exponents to rational, taylor that, and integrate the result?

Peter
Peter on 16 Mar 2014
It was case 1 Roger and what i was wanting to do was find a value for C cause I already knew the result of the integral. I found out how to do this though, it is an incomplete beta function which matalb has a function for.
betainc(X,W,Z)
where W and Z are the constants above. I then kept changing the values of X till i got the result I was looking for.
Thanks for all your time and effort.
  1 Comment
Roger Stafford
Roger Stafford on 16 Mar 2014
The 'betainc' and 'betacdf' functions give the same result.
Do you agree with the term c^a/a to be subtracted in your integral?
You could have used 'fzero' to do the searching for the correct value for c.

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!