# A better way of finding the Fourier transform of this signal

What is a nice way of finding the Fourier transform of the following signal $g(t)$? It is a cosine function with frequency $f_c$ and only appearing in the interval from $-\frac{T}{2}$ to $\frac{T}{2}$ so I think $g(t)=cos(2\pi f_c t) u(-t+\frac{T}{2}) u(t+\frac{T}{2})$. Since it is a product of three functions, then by using the convolution property I would have to convolve the Fourier transforms of the step functions first, the resulting transform function of which I would then have to convolve with the Fourier transform of the cosine function to get the Fourier transform of the product function $g(t)$. Not only does my method require two convolutions, I wasn't able to find a closed form expression for the convolution of the Fourier transforms of the two step functions. Does anyone have any idea of a better way of finding the Fourier transform of $g(t)$?

You are supposed to compute $G(f) = \int_{-T/2}^{T/2} \cos(2 \pi f_c t) e^{-2i \pi f t}dt$ directly, using $\cos(2 \pi f_c t) = \frac{e^{2i \pi f_c t}+e^{-2i \pi f_c t}}{2}$
A good alternative is to compute the Fourier transform of $h(t) = 1_{|t| < T/2}$ and use the modulation property of the Fourier transform $$FT[\cos(2 \pi f_c t) h(t)] = \frac{FT[e^{2i \pi f_c t} h(t)]+FT[e^{-2i \pi f_c t} h(t)]}{2} = \frac{H(f-f_c)+H(f+f_c)}{2}$$
Finally, what you mentioned needs the Fourier transform of distributions, because $FT[\cos(2 \pi f_c t)] = \frac{\delta(f-f_c)+\delta(f+f_c)}{2}$ where $\delta$ is the Dirac delta