confused about the limit of a trigonometric function I am trying to calculate the limit of the following function for general $a$:
$$\lim_{x\to a}[\cos(2 \pi x)-\sin(2 \pi x) \cot(\frac{\pi x}{a})]$$
I was believing this is infinite. But Mathematica calculates for $a=3$ for instance the limit is $5$
And for $a$ in general Mathematica returns an infinit term that says:
DirectedInfinity[a Sin[2 a [Pi]]] 
I can not understand the role of $a\sin(2a \pi)$
May someone here ehlp me out of confusion?
 A: HINT:
$$F=\cos 2\pi x-\sin 2\pi x\cot \frac{\pi x}a$$
$$=\frac{\sin \frac{\pi x}a\cos 2\pi x-\sin 2\pi x\cos \frac{\pi x}a}{\sin \frac{\pi x}a}$$
$$=\frac{\sin(\frac{\pi x}a-2\pi x)}{\sin \frac{\pi x}a}$$
$$=\frac{\sin(\frac{\pi x}a(1-2a))}{\sin \frac{\pi x}a}$$
If $1-2a$ is integer, $\lim_{x\to a}F=\frac00,$ we can apply L' Hospital Rule
Else the  denominator goes to zero, but the numerator doesn't, hence, the limit goes to $\infty$ 
A: DirectedInfinity is, I believe, a term that Mathematica uses to indicate a limit of infinity in the complex plane. If $a_n$ is an increasing sequence of positive numbers and $k$ is some complex number, then the limit of $ka_n$ will be expressed as DirectedInfinity[k]. (And the same for sequences that approach this type of sequence.) In the case where $a$ is real, it just means that the expression tends to either $\infty$ or $-\infty$, and the sign of $a \sin(2a\pi)$ will tell you which one.
As for the first part of your question, I think that Mathematica is substituing $x=3$ and rearranging your expression to get something like
$$ \cos(\pi) [ \frac{\cos(6\pi)}{\cos(\pi)} - \frac{\sin(6\pi)}{\sin(\pi)} ]$$.
Since $\cos(6\pi)$ can be expressed as a sixth-degree polynomial in $\cos(\pi)$ and the same for $\sin$, the part in brackets probably ends up evaluating to $-5 + 0$ or similar.
This might not be what you want, but it could be what someone else wants when writing this expression. Try the limit for $a$ not an integer, and this simplification shouldn't happen.
