# $\lim_{n\to \infty }\cos (\pi\sqrt{n^{2}-n})$ - second battle

Followed my question,

I still don't understand why the answers that were given are right.

By simply intuition and using the continuity of cosine, we get that we need to compute

$\lim_{n\to \infty}\cos (\pi n\sqrt{1-\frac{1}{n}})$ and because of that, as I see that, there are two clear limits: 1 and -1, and therefore the limit does not exist

Can someone please explain me why am I wrong? two answers that claimed that the limit is 0 got 25 votes together, so I must be mistaken, But still the answers are not satisfying me.

By the way, Wolfarmalpha claims it does not have a limit.

Thank you.

-
Do you mean '$\lim_{n\to \infty}\cos (\pi n\sqrt{1-\frac{1}{n}})$' instead of '$\lim_{x\to \infty}\cos (\pi n\sqrt{1-\frac{1}{n}})$'? – Américo Tavares Jun 18 '11 at 12:30
Yes, I edited it, thanks. Let's not make more confusion :-) no x's just n's. – user6163 Jun 18 '11 at 12:32
I don't know wolframalpha very well (I never really used it), but are you sure that it understands that $n$ only runs through the integers? As Gerry points out in his answer this is a crucial assumption. The output indicates an "essential singularity" and I interpret that as implicitly saying that $n$ runs through the reals. – t.b. Jun 18 '11 at 12:36
It's unambiguously zero. Try plugging in some large values of $n$ on a calculator and you'll see that this is correct. – Jim Belk Jun 18 '11 at 15:01

I can sort of see where your conflict arises. Using your intuition, $\sqrt{1-\frac{1}{n}}$ tends to $1$ and so $\cos\big(\pi n\sqrt{1-\frac{1}{n}}\big)$ should hit both $1$ and $-1$ infinitely often. However what you are not taking into account is that as $\sqrt{1-\frac{1}{n}}$ goes $1$, the $n$ term goes to infinity, so this makes no sense as an argument. If we use the Taylor expansion, we find $$\bigg(1-\frac{1}{n}\bigg)^{1/2} = 1-\frac{1}{2n} -\frac{1}{8n^2} + \dots$$ which gives that $\pi n \sqrt{1-\frac{1}{n}} = \pi n \big(1-\frac{1}{2n} -\frac{1}{8n^2} + \dots\big) = \pi n - \frac{\pi}{2} + O(\frac{1}{n})$. Taking the cosine of this, we get arbitrarily close to zero as $n$ becomes large.

-
I think FS means that the cosine of all this is close to zero. – Did Jun 18 '11 at 12:22
@Theo: My apologies, @Didier is right. Will clarify this now. – Fahad Sperinck Jun 18 '11 at 12:23
Now it's fine. Thank you. – t.b. Jun 18 '11 at 12:26

In the other question, you write of letting $x=2\pi k$, but there isn't any $x$, there's only $n$, and the answers you are complaining about are assuming that $n$ is only permitted to take integer values. If the intention is for $n$ to take only integer values, then you can't have $n=2\pi k$, and the upvoted answers are correct. If you want the limit as $n$ goes through the reals, then your argument is correct, and the limit doesn't exist.

-
The question was written in the same way, the $x_{k}=2\pi k$ is part of my attempt to answer my own question by defining two sqeuences. I don't get your point. – user6163 Jun 18 '11 at 12:14
I don't take it Nir is "complaining" about previous answers - just being honest about not understanding them... – amWhy Jun 18 '11 at 12:19
@Nir, my point is that the other answers are finding the limit of the sequence $\cos\pi\sqrt{1^2-1},\cos\pi\sqrt{2^2-2},\cos\pi\sqrt{3^2-3},\dots$. Since $x_k=2\pi k$ is never an integer (for integer $k\gt0$), it never shows up in this sequence, and so the values at those $x_k$ don't enter into the discussion. Here's a simpler example: $\lim_{n\to\infty}\sin\pi n$. This sequence is $0,0,0,\dots$, with limit zero; it doesn't matter that if $n=1/2$ you don't get zero; it doesn't matter because you never have $n=1/2$. – Gerry Myerson Jun 18 '11 at 12:31
+1: I added a few more words to the argument, but this is the answer that deserves credit. – Joe Johnson 126 Jun 18 '11 at 12:59

To elaborate on Gerry Myerson's answer:

The crucial step in the answer that was upvoted 20 times needs $n$ to only take integer values. The poster used

$$\cos(\pi(\sqrt{n^2-n}))=(-1)^n\cos(\pi(\sqrt{n^2-n})-n).$$

This works for $n$ an integer, because adding a multiple of $\pi$ only changes cosine by a power of -1. He then works the rest of the problem with some algebra. If $n$ can be any real number, then you can solve the equation

$$\pi(\sqrt{n^2-n})=k\pi$$

for infinitely many $k$ where $k$ is an odd integer and infinitely many $k$ where $k$ is an even integer. And therefore you get values of -1 and 1 infinitely often. The point is if $n$ is only an integer you can't solve these equations.

-

The behavior of the sequence $$\{\cos(\pi \sqrt{n^2-n})\}_{n=1}^\infty$$ and that of the function $$\cos(\pi \sqrt{x^2-x})$$ are very different, which has been pointed out by other answers and comments.

I would like to just add three pictures created with Mathematica to illustrate this point here:

-

[EDITED] You're right that normally we think of cosine as oscillating over all values over the range $[-1,1]$, across the entire real domain. And in that case, your function does not converge.

However, the answers you don't understand, are taking $n$ as increasing through the integers. And over the integers, $\cos(\pi\sqrt{n^2-n})$ behaves very differently to that over reals: because whereas over the reals, the function continues to oscillate over all values in the real range $[-1,1]$, however large $n$ gets, that's not true over the integers.

So, as long as this assumption about $n$ being an integer holds, one may discard any intuition that derives from the behaviour of cosine over the reals.

And over the integers, $\sqrt{n^2-n}$ modulo $1$ converges to $\frac{1}{2}$ as $n\to\infty$, hence, $\cos(\pi\sqrt{n^2-n})$ converges to $\cos\frac{\pi}{2}=0$.

-
@Theo Buehler, you're absolutely right, and I was wrong. Sorry. I've edited the answer to remove the wrong bit, accordingly. – EnergyNumbers Jun 19 '11 at 4:46
Thanks for the correction, now it's fine. – t.b. Jun 19 '11 at 5:59
@user6163, I can compare the situation to the limit: $\lim_{n \to \infty} \sin(n \pi)$. For any integer $n$, this is exactly zero, so the limit is also $0$. On the other hand, the function $\sin(\pi x)$ oscillates indefinitely between $\pm 1$; it has no limit as $x \to \infty$. – Srivatsan Sep 7 '11 at 2:07