Fourier Transform for Cosine-Squared I'm having trouble finding the Fourier transform of $g(t) = \cos^2{a x}$. 
I know the answer has to be a summation of $3$ dirac delta functions, but I'm having trouble showing this. I'll show you where my work ran into a problem.
First, I used the identity $\cos^2 \ (x) = 1/2 \ (1 + \cos \ (2x)$. Then, I have:
$$\hat g(k) = 1/4 \pi \ \int_{-\infty}^{\infty} (1 + \cos \ (2ax)) e^{-ikx} dx $$
I can handle the $\cos \ (2ax)e^{-ikx}$ integral fine, and make it a dirac delta function, but I don't see how I can with a simple integration of  $\int_{-\infty}^{\infty} e^{-ikx} dx$. To my knowledge, that's an indefinite integral equal to $ \frac{1}{-ik} e^{-ikx} + C$. That is not a dirac delta function. Just for context, the answer should be:
$1/4 \left(  \delta (2a-k) + \delta (2a +k) + 2\delta (k)\right)$
But I don't see how this is possible. Can someone point out what I'm doing wrong?
Also, this is using a convention for the Fourier transform that I am forced to use in university. If I used a $e^{ikx}$ convention, this would be more straightforward.
 A: The problem you encounter essentially boils down to proving 
$$
\int_{-\infty}^{+\infty}e^{-ikx}dx = 2\pi \delta(k)\,.
$$
There are many ways to prove this fact. For instance, one can first prove that the Fourier transform extends in an invertible way to tempered distribution (to which $\delta(x)$ belongs), then note that
$$
\int_{-\infty}^{+\infty} e^{ikx}\delta(k)\,dk = 1\,,
$$
and finally apply the inverse Fourier transform to obtain the desired identity. Another way I like is the following (non-formal) approach based on a regularization of the integral: for $\epsilon>0$,
$$
\int_{0}^{+\infty} e^{-(\epsilon+i k)x} dx =  \frac{1}{\epsilon+ik}\xrightarrow[\epsilon\to 0^+]{} -i \,\mathrm{PV}\frac{1}{x}+\pi \delta(k)\,,
$$
where PV denotes the principal value, while
$$
\int_{-\infty}^0 e^{(\epsilon-ik)x} dx = \frac{1}{\epsilon-ik}\xrightarrow[\epsilon\to0^+]{}+i\,\mathrm{PV}\frac{1}{x}+\pi \delta(k)\,.
$$
Hence, 
$$
\int_{-\infty}^{+\infty} e^{-ikx} dx = \lim_{\epsilon\to0^+}\int_{-\infty}^{+\infty} e^{-ikx -\epsilon|x|} dx= 2\pi \delta(k)\,.
$$
A: The simple way of how engineers do it:
$$
\cos^2(t) = \left[ \frac{e^{jt} + e^{-jt}}{2} \right]^2 = \frac{1}{4}
e^{j2t} + \frac{1}{2} + \frac{1}{4} e^{-j2t}
$$
We also know that:
$$
e^{2jt} \Longleftrightarrow 2 \pi \delta(\omega -2) \\
1 \Longleftrightarrow \pi \delta(\omega) \\
e^{-j2t} \Longleftrightarrow 2 \pi \delta (\omega + 2)
$$
After making use of the linearity of the Fourier transform:
$$
\cos^2(t) \Longleftrightarrow \frac{1}{2} \pi \delta(\omega -2) + \pi \delta(\omega) + \frac{1}{2} \pi \delta (\omega + 2)
$$
