The χ^{2} distribution with n degrees of freedom has density function given by
chisquare(n,x) = 

If you enter
you will get
which can be numerically approximated by
which is
The cumulative distribution function for the χ^{2} distribution with n degrees of freedom at a value x is chisquare_cdf(n,x) = Prob(X ≤ x); if you enter
you will get
If you give chisquare_cdf an extra argument, you will get the probability that the random variable lies between two values; chisquare_cdf(n,x,y) = Prob(x ≤ X ≤ y). If you enter
you will get
The inverse distribution function for the χ^{2} distribution with n degrees of freedom is computed with chisquare_icdf(n,h); recall that this will return the value x with chisquare_cdf(n,x) = h. If you enter
you will get
The UTPC (the Upper Tail Probability  Chisquare distribution) will compute Prob(X > x). If you enter
you will get