I use this code to calculate the indefinite integral of a complex trigonometric function:
# To compute an indefinite integral
using SymPy
# we can also use @vars x y z
x = symbols("x")
integrate((sin((x^(2) + 1)^(4)))^(3)*(cos(x^(2) + 1)^(4))*((x^(2)+1)^(3))*x)
it took long time, just like the computer is thinking and forgetting the trigonometric formula thus making it very long for me to wait. Maybe the problem is my processor or RAM is not good enough. If there is any other method to calculate the complex function of indefinite integral do tell me.
With SymPy it seems to need a bit of help with the substitution. This somewhat excessive pattern mirrors what might be done in a textbook:
using SymPy
@syms x dx v dv
constant(ex) = prod(x for x in ex.as_ordered_factors() if x.is_constant())
ex = sin((x^(2) + 1)^(4))^(3)*(cos((x^(2) + 1)^(4))*((x^(2)+1)^(3)))*x * dx
u = (x^2 + 1)^4
du = diff(u, x) * dx
c = constant(du)
duâ‚‘ = du/c
ex1 = subs(ex, duâ‚‘ => dv/c, u=>v, dv=>1)
integrate(ex1, v)(v => u)