The first, use integration by parts, integrating the trig function so that the x 'disappears' when differentiated. To integrate the fraction, sub u = cos x, or better still see it (the fraction) as a chain-rule derivative (spotting sin as the inner derivative), or else re-write as tan x sec x, as here,

integrate x sin x / cos^2 x - Wolfram|Alpha

For sec itself, see Balloon Calculus: standard integrals, derivatives and methods #sec

The second is more usually written cot (for cotangent). Apply a reduction formula as here,

integrate ctg^7 x - Wolfram|Alpha

or develop your own, using , and doing integration by parts on

...