explicit integral could not be found
    7 views (last 30 days)
  
       Show older comments
    
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.
0 Comments
Answers (3)
  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.
0 Comments
  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?
0 Comments
  Peter
 on 16 Mar 2014
        1 Comment
  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.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!