For the integral , use the Weierstrass substitution, then . Use partial fractions, then .
Both integral can be evaluated with the same method:
and
Therefore, . Substitute back , we obtain .