# HP Forums

You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm playing with CAS.

I tried to calculate the gamma function using my own definition (not the internal one).

g(x):=int(e^(-t)*t^(x-1),t,0,+infinity)

The CAS convert the +infinity to a +/-infinity. When you try to calculate the function using an integer value you obtain the right result:

g(5) gives 24

When you try to calculate the gamma for a rational number or a decimal you obtain this symbolic result:

g(5+1/3) gives int(t^5*e^(-t)/(t^(1/3))²,t,0,+/-infinity)

You can note that +infinity mutates in +/-infinity.

Why?
Doesn't happen to me.

define in CAS

g(t):=int(x^(t-1)*exp(-x),x,0,inf)

g(5)=24 OK

g(5+1/3)=int((3*x^4*x*e(-x))/3*(x^1/3)^(-2),x,0,inf) Note: No change to +/-inf

approx(Ans)=40.1289... OK
(02-16-2014 08:03 PM)Helge Gabert Wrote: [ -> ]Doesn't happen to me.

I have CAS in Exact mode.
So do I.
On my calc or emulator, the problem appears when you set the Simplify settings in CAS to Minimum.
If you set it to None or Maximum the behavior is as expected.

BTW I set it to None and tried to obtain the same "error" by hand but I have not obtained any success so far.
The expand function changes +infinity in -/+infinity:

expand(int(t^x*e^(-t),t,0,+infinity))

gives

int(t^x*e^(-t),t,0,+/-infinity)
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :