Solving Integrals 
For nonnegative integers $n$, let  $$ A_n(x) := \int_0^x
 \sin^n{t}\,dt\quad  $$
(i) For $n \geq 2$, find a formula for $A_n(x)$ in terms of
  $A_{n-2}(x)$.
(ii) Evaluate  $$\int _0^{\frac{\pi }{4}}\sin^{n-2}t\left(\frac{1}{n}-\cos^2t\right)dx$$ Your answer
  should be in terms of $n$.

I have no idea how to solve both parts. I tried to use integration by parts for (i), but I ended up with a really messy equation with no An-2 appearing anywhere. Any help will be greatly appreciated!!
 A: Integration by parts is the way. Perhaps you didn't split your integrand well. Write this as $\sin^{n-1}t\sin t,$ so that we have $$A_n=\sin^{n-1}t\int \sin t\mathrm dt-\int (n-1)\sin^{n-2}t\cos t(-\cos t)\mathrm dt=\sin^{n-1}t(-\cos t)+\int(n-1)\sin^{n-2}t(1-\sin^2t)\mathrm dt=-\cos t\sin^{n-1}t+(n-1)\int\sin^{n-2}t\mathrm dt-(n-1)\int\sin^nt\mathrm dt=-\cos t\sin^{n-1}t+(n-1)A_{n-2}-(n-1)A_n.$$
Can you now continue to solve for $A_n$ in terms of $A_{n-2}$ as wanted?
For the second part, just apply the reduction formula.
A: As yourself do, Integrate it by Parts, as @GEdgar said and @Allawonder did twice:
$$A_n = \frac{n-1}{n}A_{n-2} -\frac{1}{n} \cos x \sin^{n-1}x$$
Now for second part, as @Allawonder said, you should apply part one result:
$$\int_0^{\frac{\pi}{4}} \sin^{n-2}t (\frac{1}{n} - \cos^2t) dt = \int_0^{\frac{\pi}{4}} \sin^{n-2}t (\frac{1-n}{n} + \sin^2t) dt = \int_0^{\frac{\pi}{4}} \frac{1-n}{n}\sin^{n-2}t + \sin^nt dt$$
$$ = \frac{1-n}{n}A_{n-2}(\frac{\pi}{4}) + A_n(\frac{\pi}{4}) = -\frac{1}{n} \cos (\frac{\pi}{4})\sin^{n-1} (\frac{\pi}{4}) = -\frac{1}{n}\left(\frac{1}{\sqrt2}\right)^n$$
