How to compute and think intuitively about $\limsup$ and $\liminf$ of the below function? $$x_n = \frac{n^2}{1+n^2} \cos \frac{n \pi}{16} $$
Could someone please let me know how to derive the limits in this case?
I can think — with using l'Hopital rule the limit of $\frac{n^2}{1+n^2} $ is $1$. So can I just say that, it will be multiplied with extremum values of $\cos$ function? How to prove this? and also how to think about $\limsup$ and $\liminf$ intuitively in this case?
 A: In this case you're right that the $\liminf$ and $\limsup$ are $-1,1$ respectively, and intuitively the reason you suggested is right. The sequence $\frac{n^2}{1+n^2}$ approaches $1$ (you don't even need L'Hopital's rule... personally I think L'Hopital's rule is over used even for simple limit calculations), while $\cos\left(\frac{n\pi}{16}\right)$ can oscillate between $\pm 1$.
More formally, we can prove things like this. Recall that one of the possible definitions of $\limsup$ is to take the supremum of all possible subsequential limits. In this case, we have that for all $n\in\Bbb{N}$, $-1\leq x_n\leq 1$, so definitely we have $-1\leq \limsup\limits_{n\to \infty}x_n \leq 1$. On the other hand, consider the subsequence
$\{x_{32n}\}_{n=1}^{\infty}$. We have
\begin{align}
x_{32n}&=\frac{(32n)^2}{1+(32n)^2}\cos(2n\pi) = \frac{(32n)^2}{1+(32n)^2},
\end{align}
and as $n\to \infty$, the limit is $1$. Thus, we have found a subsequence which has limit $1$, so because $\limsup\limits_{n\to\infty} x_n$ is by definition the supremum of subsequential limits, we must have $\limsup\limits_{n\to\infty}x_n \geq 1$. Combining with what we said above it follows that $\limsup\limits_{n\to\infty}x_n = 1$.
Another possible definition is $\limsup\limits_{n\to\infty} x_n:= \lim\limits_{n\to\infty}\sup\limits_{k\geq n}x_k$. Note that the sequence $x_k=\frac{k^2}{1+k^2}=1-\frac{1}{1+k^2}$ increases to $1$; also by taking $k$ to be even multiples of $16$, it follows that for every $n\in\Bbb{N}$, we have that $\sup\limits_{k\geq n}x_k = 1$. Hence, taking the limit as $n\to\infty$ still yields $1$; i.e
\begin{align}
\limsup_{n\to\infty}x_n&:= \lim_{n\to\infty}\sup_{k\geq n}x_k = \lim_{n\to\infty} 1 = 1.
\end{align}
I'll leave the case of $\liminf$ to you.
