$\lim_{n\rightarrow \infty}\frac{(3n+1)f(n)}{(2n+1)^2g(n)}$ is 
Let $\displaystyle f(n) = \int^{1}x^{n-1}\sin \bigg(\frac{\pi x}{2}\bigg)dx$ and $\displaystyle g(n)=\int^{1}_{0}x^{n-1}\cos\bigg(\frac{\pi x}{2}\bigg)dx$ where $n$ 
  is a natural number
   and $\displaystyle \lim_{n\rightarrow \infty}\frac{(3n+1)f(n)}{(2n+1)^2g(n)}=\frac{a}{b\pi}.$ Then what is the least value of $a+b$?

Plan
$$f(n)=-\frac{2\pi }x^{n-1}\cos(\pi x/2)\bigg)\bigg|^{1}_{0}+\frac{2(n-1)}{\pi}\int^{1}_{0}x^{n-1}\cos(\pi x/2)dx$$ 
$$f(n)=\frac{2(n-1)}{\pi}g(n-1)=\frac{2^2}{\pi^2}(n-1)(n-2)g(n-2)$$
How do I solve it?
 A: 
Lemma. If $f:[0,1]\to\mathbb R$ is a continuous function then
  $$\lim_{n\to\infty}n\int_0^1 f(x)x^{n-1}\,dx=f(1).$$

Proof. See this question.
Hence it follows that
$$\lim_{n\to\infty}nf(n)=\sin(\pi/2)=1.$$
Now, you have shown that
$$g(n)=\frac\pi2\frac{f(n+1)}n$$
so 
$$\lim_{n\to\infty}n^2g(n)=\frac\pi2$$
and the problem reduces to a simple computation.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\bbox[10px,#ffd]{\int_{0}^{1}x^{n - 1}\expo{\ic\pi x/2}\dd x} =
\int_{0}^{1}\pars{1 - x}^{n - 1}\expo{\ic\pi\pars{1 - x}/2}\dd x
\\[5mm] = &\
\ic\int_{0}^{1}
\exp\pars{\vphantom{\Large A}\bracks{n - 1}\ln\pars{1 - x}}
\expo{-\ic\pi x/2}\dd x
\\[5mm] \stackrel{\mrm{as}\ n\ \to\ \infty}{\sim}\,\,\,&
\ic\int_{0}^{\infty}
\exp\pars{-\bracks{n - 1}x}\pars{1 - {\ic\pi \over 2}\,x -
{\pi^{2} \over 8}\,x^{2}}\dd x
\\[5mm] \stackrel{\mrm{as}\ n\ \to\ \infty}{\sim}\,\,\,&
{\pi/2 \over \pars{n - 1}^{2}} + {\ic \over n - 1}
\\[5mm] \implies &
\bbx{\left\{\begin{array}{rcrcl}
\ds{\mrm{g}\pars{n}} & \ds{\equiv} & \ds{\int_{0}^{1}x^{n - 1}\cos\pars{\pi x \over 2}\dd x}
& \ds{\stackrel{\mrm{as}\ n\ \to\ \infty}{\sim}} &
\ds{\pi/2 \over \pars{n - 1}^{2}}
\\[2mm]
\ds{\mrm{f}\pars{n}} & \ds{\equiv} & \ds{\int_{0}^{1}x^{n - 1}\sin\pars{\pi x \over 2}\dd x}
& \ds{\stackrel{\mrm{as}\ n\ \to\ \infty}{\sim}} &
\ds{1 \over n - 1}
\end{array}\right.}
\\[8mm] \implies &
\lim_{n \to \infty}{\pars{3n + 1}\,\mrm{f}\pars{n} \over
\pars{2n + 1}^{2}\,\mrm{g}\pars{n}} =
\lim_{n \to \infty}{\pars{3n + 1}\bracks{1/\pars{n - 1}} \over
\pars{2n + 1}^{2}\bracks{\pars{\pi/2}/\pars{n - 1}^{2}}}
\\[5mm] = &\
\bbx{3 \over 2\pi}
\end{align}
