Ask Your Question

Revision history [back]

f=function('f')
def T(f,n,x): 
    ans=0
    for v in range(n+1):
        ans=ans+binomial(n,v)*f(v+1)*(x)^v
    return ans

print T(f,4,x)

gives:

x^4*f(5) + 4*x^3*f(4) + 6*x^2*f(3) + 4*x*f(2) + f(1)