def dup_integrate(f, m, K):
 if ((m <= 0) or (not f)):
  return f
 g = ([K.zero] * m)
 for (i, c) in enumerate(reversed(f)):
  n = (i + 1)
  for j in range(1, m):
   n *= ((i + j) + 1)
  g.insert(0, K.exquo(c, K(n)))
 return g

def dup_integrate ( f , m , K ) : if ( ( m <= 0 ) or ( not f ) ) : return f g = ( [ K . zero ] * m ) for ( i , c ) in enumerate ( reversed ( f ) ) : n = ( i + 1 ) for j in range ( 1 , m ) : n *= ( ( i + j ) + 1 ) g . insert ( 0 , K . exquo ( c , K ( n ) ) ) return g
computes the indefinite integral of f in k[x] .