def dmp_integrate(f, m, u, K):
 if (not u):
  return dup_integrate(f, m, K)
 if ((m <= 0) or dmp_zero_p(f, u)):
  return f
 (g, v) = (dmp_zeros(m, (u - 1), K), (u - 1))
 for (i, c) in enumerate(reversed(f)):
  n = (i + 1)
  for j in range(1, m):
   n *= ((i + j) + 1)
  g.insert(0, dmp_quo_ground(c, K(n), v, K))
 return g

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