Asymptotic behaviour of a sequence with finite sum I'm working on$$
u_n=\sum_{k=0}^{n}\frac{1}{k^2+(n-k)^2}
$$
to find out an asymptotic behaviour as $n \rightarrow +\infty.$ I've already seen that $u_n$ tends to $0$.
Thanks for your help.
 A: Note that
$$
nu_n=\sum_{k=0}^{n}\frac{n}{k^2 + (n-k)^2}=\frac{1}{n}\sum_{k=0}^{n}\frac{1}{(k/n)^2+(1-k/n)^2}\sim\int_{0}^{1}\frac{dk}{k^2+(1-k)^2}=\frac{\pi}{2}
$$
as $n\rightarrow\infty$; so $u_n \sim \pi/(2n)$ in that limit.
A: Factor out $n^2$. You get $\frac{1}{n^2}\frac{1}{k^2/n^2+(1-k/n)^2}$ and if you relable $u=k/n$ you are effectively approximating the integral
$$\int_0^1\frac{du}{u^2+(1-u)^2}.$$
It should be easy to evaluate so your series tends to a constant divided by $n$, eg it is $O(1/n)$. 
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$

$\ds{u_{n}\equiv\sum_{k\ =\ 0}^{n}{1 \over k^{2} + \pars{n - k}^{2}}\,.\quad}$ 
  Asymptotic behavior as $\ds{n\ \to\ \infty:\ {\large ?}}$

\begin{align}
u_{n}&\equiv
\sum_{k\ =\ 0}^{\infty}\bracks{%
{1 \over k^{2} + \pars{n - k}^{2}}-
{1 \over \pars{k + n + 1}^{2} + \pars{k + 1}^{2}}}
\\[5mm]&=\sum_{k\ =\ 0}^{\infty}{1 \over k^{2} + \pars{n - k}^{2}}
-\sum_{k\ =\ 1}^{\infty}{1 \over k^{2} + \pars{k + n}^{2}}
\\[5mm]&={1 \over n^{2}}+
\bracks{\color{#c00000}{\sum_{k\ =\ 0}^{\infty}{1 \over k^{2} + \pars{n - k}^{2}}}
- \pars{n\ \to\ -n}}\tag{1}
\end{align}

Then,
  \begin{align}&\color{#c00000}{%
\sum_{k\ =\ 0}^{\infty}{1 \over k^{2} + \pars{n - k}^{2}}}
=\half\sum_{k\ =\ 0}^{\infty}{1 \over k^{2} -nk + n^{2}/2}
=\half\sum_{k\ =\ 0}^{\infty}{1 \over \bracks{k - {\rm r}_{-}\pars{n}}
\bracks{k - {\rm r}_{+}\pars{n}}}
\\[5mm]&\mbox{where}\quad {\rm r}_{\pm}\pars{n} \equiv {1 \pm \ic \over 2}\,n
\quad\mbox{such that:}
\\[5mm]&\color{#c00000}{%
\sum_{k\ =\ 0}^{\infty}{1 \over k^{2} + \pars{n - k}^{2}}}
=\half\,{\Psi\pars{-{\rm r}_{-}\pars{n}} - \Psi\pars{-{\rm r}_{+}\pars{n}}
\over \bracks{-{\rm r}_{-}\pars{n}} - \bracks{-{\rm r}_{+}\pars{n}}}
\end{align}
  $\ds{\Psi\pars{z}}$ is the Digamma Function and
  \begin{align}
&\color{#c00000}{%
\sum_{k\ =\ 0}^{\infty}{1 \over k^{2} + \pars{n - k}^{2}}}
=-\,\half\,{2\ic\,\Im\Psi\pars{-{\rm r}_{+}\pars{n}} \over \ic n}
=-\,{\Im\Psi\pars{-{\rm r}_{+}\pars{n}} \over n}
\\[5mm]&=-\,{1 \over n}\,\Im\Psi\pars{{-1 - \ic \over 2}\,n}
\end{align}

Replacing in expression $\pars{1}$:
\begin{align}
\color{#66f}{\large u_{n}}&={1 \over n^{2}} + \braces{%
-\,{1 \over n}\,\Im\Psi\pars{{-1 - \ic \over 2}\,n}
-\bracks{{1 \over n}\,\Im\Psi\pars{{1 + \ic \over 2}\,n}}}
\\[5mm]&=\color{#66f}{\large-\,{1 \over n}\bracks{%
\Im\Psi\pars{{-1 - \ic \over 2}\,n} + \Im\Psi\pars{{1 + \ic \over 2}\,n}}
+
{1 \over n^{2}}}
\end{align}

With the
  Digamma Asymptotic Formula
  $$
\Psi\pars{z}\sim
\ln\pars{z} - {1 \over 2z} - {1 \over 12 z^{2}} + \cdots\,,\qquad
\verts{z}\ \to\ \infty\quad \mbox{in}\quad \verts{{\rm arg}\pars{z}}\ <\ \pi
$$

we'll have
\begin{align}
u_{n}&\sim -\,{1 \over n}\bracks{-\,{3\pi \over 4} + {\pi \over 4}} + {1 \over n^{2}}
=\color{#66f}{\large{\pi \over 2}\,{1 \over n} + {1 \over n^{2}}}\,,\qquad
n\ \to\ \infty
\end{align}
A: Set $\displaystyle f(x):=\frac{1}{x^2+(1-x)^2}$. We have
$$
u_n=\frac{1}{n^2}\sum_{k=0}^{n}f\left(\frac{k}{n}\right)
$$
Since $f$  is a continuous function on $[0,1]$, $nu_n$ is then a related Riemann sum, as $n$ tends to $+\infty$, we have:
$$
\begin{align}
n\:u_n &=\frac{1}{n}\sum_{k=0}^{n}f\left(\frac{k}{n}\right)\\\\
&=\int_0^1f(x)\:dx+\mathcal{o}(1)\\\\
&=\int_0^1\frac{1}{x^2+(1-x)^2}\:dx+\mathcal{o}(1)\\\\
&=\int_0^1\frac{2}{1+(2x-1)^2}\:dx+\mathcal{o}(1)\\\\
&=\arctan(2\times 1-1)-\arctan(2\times 0-1)+\mathcal{o}(1)\\\\
&=\frac{\pi}{2}+\mathcal{o}(1)
\end{align} 
$$
giving the asymptotic expansion
$$ u_n=\frac{\pi}{2n}+\mathcal{o}\left(\frac{1}{n}\right).$$
