integrate (cos(theta) + D)^m d theta