MATLAB: Help please, problem with integration

gamma functionMATLABnumerical integration

Hello everyone,
Using symbolic, I'm trying to integrate the following function (that includes gamma function):
syms A u t
A=1;
u=X*cos(t)+Y*cos(3*t);
f=u^(1/3);
c3=int(f*cos(3*t),t,0,pi/2)*4/pi;
C1=eval(c1);
but Matlab doesn't calculate. Here is the message:
Warning: Explicit integral could not be found.
> In sym.int at 58
In FourthApprox_Example3 at 27
??? Error using ==> sym.maple at 87
Error, (in content/gcd) too many levels of recursion
Error in ==> sym.int at 51
r = reshape(maple('map','int',f(:),[x.s '=(' a.s ')..(' b.s ')']),size(f));
Error in ==> FourthApprox_Example3 at 29
c3=int(f*cos(3*t),t,0,pi/2)*4/pi;
So I'm wondering how it would be to calculate in a numerical notation with quad, quadgk or quadl. Or if there is a way to calculate without numerical functions.
Thank you very much

Best Answer

I'm not terribly sure why you tell us that A=1, as it is the only parameter that is not used at all here. I'm also not at all sure why you have C1=eval(C1) in there, as we never see C1 either. And your title claims that this somehow includes the gamma function. Don't see that either.
You have unknown parameters X and Y. How could you expect to do a numerical integration with them as unknowns? Or are X and Y known, and you are not telling us what they are? Can we guess? If so, then I pick:
X = 42;
Y = 17;
If X and Y are known parameters, then I don't see the problem with a numerical integration, since an analytical solution is clearly not to be found. Not every problem has a clean solution. I'd start with quadgk or integral.
Related Question