Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Does wrapping the expression with a python function fits your needs?

var("s n t")
term= sqrt(s/n)*1/sqrt(2*pi)*exp(-s*t^2/(2*n))*exp(-s/2)*s^(n/2-1)/(gamma(n/2)*2^(n/2))

def tdist(k):
    return integral(term.substitute(n=k),s,0,infinity)

tdist(4)

Does wrapping the expression with a python function fits fit your needs?

var("s n t")
term= sqrt(s/n)*1/sqrt(2*pi)*exp(-s*t^2/(2*n))*exp(-s/2)*s^(n/2-1)/(gamma(n/2)*2^(n/2))

def tdist(k):
    return integral(term.substitute(n=k),s,0,infinity)

tdist(4)