Just looking at the integrand:

We can postulate, then, that

That is,

Integrating gives you the logarithm of the trig functions (one has a minus sign), since the derivatives of the denominators are like the numerators.

For the second problem, you have

renders this an equality. Hence, we get

Integrating yields