Show that, for $n> 0$, $$ \int_0^{\frac14\pi} \tan^n x \sec^2 x \, \mathrm{d} x = \frac 1 {n+1} \; \quad \text{and} \quad \int_0^{\frac14\pi} \sec ^n x \tan x \, \mathrm{d} x = \frac{(\sqrt 2)^n - 1}n . $$
Evaluate the following integrals: $$ \int_0^{\frac14\pi} x \sec ^4 x \tan x \, \mathrm{d} x \quad \text{and} \quad \int_0^{\frac14\pi} x^2 \sec ^2 x \tan x \, \mathrm{d} x . $$