I have two trig functions that i cannot seem to find a way to integrate. They are:

INTEGRAL of: 31(1+cos(x))^2

This one looks pretty simple but whenever i check my answer my taking the derivative of it, it never comes out right.

and

INTEGRAL of: 27(sin(x)/(cos(x))^3

Im suppose to have my answer in terms of tangent. Which messes me up because usually i would do a trig substitution to cancel out the sine. If its not possible to express it in terms of tangent then what is it in terms of sine and cosine.