What is $\lim_{x\to0} \frac{(\cos x + \cos 2x + \dots+ \cos nx - n)}{\sin x^2}$? What is the limit of $$\lim_{x\to0} \frac{\cos x + \cos 2x + \dots+ \cos nx - n}{\sin x^2}$$
 A: We have by taylor series
$$\cos(kx)\sim_0 1-\frac{k^2}{2}x^2$$
and
$$\sin x^2\sim_0 x^2$$
hence
 $$\lim_{x\to0} \frac{(\cos x + \cos 2x + ...+ \cos nx - n)}{\sin x^2}= -\frac{1}{2}\sum_{k=1}^n k^2=-\frac{n(n+1)(2n+1)}{12}$$
A: $$
\begin{align}
& \lim_{x\to0}\frac{\cos x+\cos 2x+\cdots+\cos nx-n}{\sin x^2} \\[10pt]
& =\lim_{x\to0} \frac{\cos x -1+\cos 2x -1+\cdots+\cos nx-1}{x^2} \cdot\frac{x^2}{\sin x^2} \\[10pt]
& = -\left(\frac{1}{2} + \frac{4}{2}+\frac{9}{2}+\cdots+\frac{n^2}{2}\right)\cdot1=-\frac{n(n+1)(2n+1)}{12}.
\end{align}
$$
We applied
$$\lim_{x\to0}\frac{1-\cos nx}{x^2}=\frac{n^2}{2} $$
A: As $x \to 0$ both the numerator and denominator tend to zero, so you can apply L'Hôpital's rule to get
$$\lim_{x \to 0} \dfrac{\sum_{k=1}^n \cos kx - n}{\sin x^2} = \lim_{x \to 0} \dfrac{\sum_{k=1}^n -k\sin kx}{2x\cos x^2} = \lim_{x \to 0} \dfrac{-1}{2\cos x^2} \sum_{k=1}^n \dfrac{k\sin kx}{x}$$
Can you see what to do now?
Hint (hover mouse over to see):

 Write $$\dfrac{k \sin kx}{x} = k^2 \dfrac{\sin kx}{kx}$$ and use the fact that $$\lim_{\theta \to 0} \dfrac{\sin \theta}{\theta} = 1$$

A: We have
$$\sum_{k=1}^n \cos(kx) = \dfrac{\sin(nx/2) \cos((n+1)x/2)}{\sin(x/2)}$$
Hence, we have
$$\dfrac{\dfrac{\sin(nx/2) \cos((n+1)x/2)}{\sin(x/2)} - n}{\sin(x^2)} = \dfrac{\sin(nx/2) \cos((n+1)x/2) - n\sin(x/2)}{\sin(x^2)\sin(x/2)}$$
Expanding around $0$ gives us
$$\dfrac{\left(nx/2 - \dfrac{(nx/2)^3}{3!} + \mathcal{O}(x^5)\right) \left(1-\dfrac{(n+1)^2x^2/4}{2!} + \mathcal{O}(x^4)\right)-n\left(x/2 - \dfrac{(x/2)^3}{3!} + \mathcal{O}(x^5) \right)}{x^3/2 + \mathcal{O}(x^4)}$$
Now cancel off the terms and conclude the limit.
A: Try using the L'Hopital Rule. Since the numerator and denominator both tend to 0 as x tends to 0, the limit of the quotient will be the same as the limit of the quotient of the differentiated functions.
$$\lim_{x\to0} \frac{cosx+cos2x+...+cosnx -n}{sinx^2}=\lim_{x\to0} \frac{-sinx-2sin2x-...-nsinnx}{cosx^2*2x}=\lim_{x\to0} \frac{-cosx-4cos2x-...-n^2cosnx}{2cosx^2-2xsinx^2}$$ (Applying L'Hopital Rule twice)
This limit is minus half of the sum of squares from 1 to n.
