$\lim_{x\to 0} \frac{\cos \left(\pi \cdot \frac{1-\cos (ax)}{x^2}\right)}{x^2} $ I have to find for which values of $a \in \Bbb N, a \ne 0$ the following limit exists and it is finite:
$$\lim_{x\to 0} \frac{\cos \left(\pi \cdot \frac{1-\cos (ax)}{x^2}\right)}{x^2}  $$
Applying L'Hôpital's rule:
$$\frac{1-\cos (ax)}{x^2}\sim \frac{\sin (ax) \cdot a}{2x}\sim \frac{a^2}{2}$$
Then $$ \frac{\cos (\pi \cdot \frac{1-\cos (ax)}{x^2})}{x^2}  \sim   \frac{\cos (\pi \cdot \frac{a^2}{2})}{x^2}.$$
$$\cos (\pi \cdot \frac{a^2}{2})=0 \implies a^2=1+2k, \quad k \in \Bbb N$$
and in this case the limit is $0$.
In the book the suggested solution is $a^2=1+2k$ for which the limit is $$ \frac{(-1)^k \cdot (2k+1)^2\cdot\pi}{24}$$
but I don't understand this solution.
Trying to solve the limit with $a^2=1+2k$:
$$ \frac{\cos \left(\pi \cdot \frac{1-\cos (ax)}{x^2}\right)}{x^2} \sim \frac{-\sin (\pi \cdot \frac{1-\cos ax}{x^2}) \cdot \pi \cdot  \frac{\sin (ax)  a  x^2 - (1-\cos (ax))  2x}{x^4}}{2x} $$$$ =  \sin \left( \frac{\pi}{2}+k \pi\right) \cdot \pi \cdot \frac{(1-\cos(ax))2- \sin(ax) ax}{2 \cdot x^4}$$$$= (-1)^k \cdot \pi \cdot \frac{(1-\cos(ax))2- \sin(ax) ax}{2 \cdot x^4} $$
 A: This part of what you wrote is incorrect:
$$\frac{\cos (\pi \cdot \frac{1-\cos (ax)}{x^2})}{x^2}  \sim   \frac{\cos (\pi \cdot \frac{a^2}{2})}{x^2}$$
You're taking the limit of the top of the fraction, but not the bottom. Instead, you need to consider under what circumstances the limit of the entire fraction might exist. Of course, this can only happen if the top tends towards zero, i.e. if
$$\cos (\pi \cdot \frac{a^2}{2}) = 0$$
So the limit might exist if $a^2 = 1 + 2k$ for some $k \in \mathbb N$. Next, assuming $a$ is one of these values, compute the limit of the entire fraction using L'Hospital's rule:
$$
\lim_{x\to 0} \frac{\cos \left(\pi \cdot \frac{1-\cos (ax)}{x^2}\right)}{x^2} = \lim_{x\to 0} \frac{\frac{d}{dx} \space \cos \left(\pi \cdot \frac{1-\cos (ax)}{x^2}\right)}{\frac{d}{dx} x^2} $$
$$ = \lim_{x\to 0} \frac{-\pi \left(\frac{a\sin(ax)x - 2(1 - \cos(ax))}{x^3}\right)\sin(\pi\cdot\frac{1 - \cos(ax)}{x^2})}{2x}
$$
$$
= \left( \lim_{x\to 0} \frac{-\pi\cdot(a \sin(ax) x - 2\cdot(1 - \cos(ax)))}{2x^4} \right) \left( \lim_{x\to 0} \sin\left(\pi \frac{1 - \cos(ax)}{x^2}\right) \right)
$$
You already know the second limit is $\sin\left(\pi\cdot\frac{a^2}{2}\right) = \pm 1$ (depending on the particular value of $a$). The first limit is straightforward. Just apply L'Hospital's Rule repeatedly until you have your answer.
A: Using l'Hôpital in this case is not the best strategy. You have
$$
\cos(ax)=1-\frac{a^2x^2}{2}+\frac{a^4x^4}{24}+o(x^4)
$$
and therefore
$$
\pi\frac{1-\cos(ax)}{x^2}=\pi\frac{a^2}{2}-\pi\frac{a^4x^2}{24}+o(x^2)
$$
In order for the limit to be finite, we need that
$$
\frac{a^2\pi}{2}=\frac{\pi}{2}+k\pi
$$
for some integer $k$, so $a^2=1+2k$. Now the numerator is
$$
\cos\Bigl(\frac{\pi}{2}+k\pi-\frac{a^4\pi x^2}{24}+o(x^2)\Bigr)=
(-1)^k\sin\Bigl(\frac{a^4\pi x^2}{24}+o(x^2)\Bigr)=
(-1)^k\frac{a^4\pi x^2}{24}+o(x^2)
$$
and therefore the limit is
$$
(-1)^k\frac{(2k+1)^2\pi}{24}
$$
Obviously $k$ should be a nonnegative integer.
A: Although a solution is provided (and was accepted) I wanted provide a solution using Maclaurin series of cos:
$$
cos(x)=1-x^2/2!-x^4/4!+x^6/6!-...
\\ cos(ax) = 1-a^2x^2/2!-a^4x^4/4!+a^6x^6/6!-...
\\ 1-cos(ax) = a^2x^2/2!+a^4x^4/4!-a^6x^6/6!+...
\\ \frac{(1-cos(ax)}{x^2} = a^2/2!+a^4x^2/4!-a^6x^4/6!+... 
\\ \lim_{x\to 0} \frac{\cos \left(\pi \cdot \frac{1-\cos (ax)}{x^2}\right)}{x^2} = \lim_{x\to 0} \frac{\cos \left(\pi \cdot (a^2/2!+a^4x^2/4!-a^6x^4/6!+... ) \right)}{x^2} 
$$
Since the denominator in $\lim_{x\to 0}$ goes to zero, in order for the limit exist, the numerator also should go to zero for $\lim_{x\to 0}$:
$$
\lim_{x\to 0} {\cos \left(\pi \cdot (a^2/2!+a^4x^2/4!-a^6x^4/6!+... ) \right)} = \lim_{x\to 0} {\cos \left(\pi \cdot a^2/2 \right)}
$$
for ${\cos \left(\pi \cdot a^2/2 \right)}$ to be zero $a^2$ should be $1+2k$
In this case we can apply the L'Hospital's Rule:
$$
\lim_{x\to 0} \frac{\cos \left(\pi \cdot (a^2/2!+a^4x^2/4!-a^6x^4/6!+... ) \right)}{x^2} = \lim_{x\to 0} \frac{-\sin \left(\pi \cdot (a^2/2!+a^4x^2/4!-a^6x^4/6!+... ) \right)(\pi (a^4(2x)/4!-4a^6x^3/6!+... ))}{2x}
= {-\sin \left(\pi \cdot a^2/2 \right)\pi a^4/4!} = \pm \pi a^4/24
$$
for which it is positive if k is even, and it is negative if k is odd.
A: You need to ensure that $$\dfrac{1-\cos ax} {x^2}\to\dfrac{2k+1}{2}$$ so that the limit in question exists. This clearly means that $a\neq 0$ and further $$a^2=2k+1$$ and thus $k\geq 0$.
Now we can write expression in question as $$(-1)^k\cdot\dfrac {\sin\left(\dfrac{(2k+1)\pi}{2}\left(1-\dfrac{2}{2k+1}\cdot \dfrac{1-\cos ax}{x^2}\right)\right)}{x^2}$$ which can be written as $(-1)^{k}(\sin f(x)) /x^2$ where $f(x) \to 0$. And we rewrite it as $$(-1)^k\cdot \frac{\sin f(x)}{f(x)} \cdot\frac{f(x)} {x^2}$$ Thus the desired limit equals the limit of $$(-1)^k\cdot\frac{1}{x^2}\cdot\frac{(2k+1)\pi}{2}\left(1-\frac{2}{2k+1}\cdot\frac{1-\cos ax} {x^2}\right)=(-1)^k\cdot \frac{\pi} {2}\frac{a^2x^2-4\sin^2(ax/2)}{x^4}$$ Putting $ax=2t$ we can see that the above equals $$(-1)^k\frac{a^{4}\pi}{8}\frac{t^2-\sin^2t}{t^4}$$ You can easily check via factoring that last factor tends to $1/3$ and hence the desired limit is $$(-1)^k\cdot\frac{(2k+1)^2\pi}{24}$$
