This probably fits dsp.stackexchange.com better.
This is the most simple FT that you should understand. The basic rule is: a sine of frequency f0 in time domain is a delta at f0 and -f0 in frequency. You can do this theoretically, as shown in http://mathworld.wolfram.com/FourierTransformCosine.html.
Those peaks in your graph are consistent with this. However, it isn't true that there is a peak in at 90Hz. The peaks should be at 10 Hz and -10 Hz. There are two possible approaches here:
a) Use fftshift to correct this issue. This will take each frequency to its real place.
Fs=100; %sampling frequency
T=1; %signal length
N=T*Fs; %number of samples
f=-Fs/2:Fs/N:Fs/2-Fs/N; %frequency vector
x=cos(2*pi*10*t);
Xf=fft(x);
Xf=fftshift(Xf);
plot(f,abs(Xf)) %magnitude
b) Assume the signal is real, so the spectrum is symmetric. It is true in this case, but it doesn't have to. You could just plot the first half of your fft, i.e. from 0 Hz to 50 Hz.
This is too long for a comment. I also needed the extra space. Feel free to comment anything.
The thing you are really asking is if the calculation is made with T/8 or T/4 or T/2. The thing is, the signal has a period of T/2, so that's the value you need to use. Now, we also need to take into account the time interval where the signal is 0. To do that, we need to define the signal properly.
The first thing you should do is to describe the signal, that is:
$$
f(t)=\left\{\begin{array}{ccc}\Biggl|A\sin\Bigl(2\pi\frac{4}{T}t\Bigr)\Biggr|&&t\in\biggl(0+k\frac{T}{2},\frac{T}{4}+k\frac{T}{2}\biggr),\,k\in\mathbf{Z}\\0&&t\in\biggl(\frac{T}{4}+k\frac{T}{2},\frac{T}{2}+k\frac{T}{2}\biggr),\,k\in\mathbf{Z}
\end{array}\right.$$
Note the sinusoid has amplitude A and period T/4, but the second semi-period is positive (so we use the absolute value).
The expression for f(t) is the same as:
$$
f(t)=\left\{\begin{array}{ccc}A\sin\Bigl(2\pi\frac{4}{T}t\Bigr)&&t\in\biggl(0+k\frac{T}{2},\frac{T}{8}+k\frac{T}{2}\biggr),\,k\in\mathbf{Z}\\-A\sin\Bigl(2\pi\frac{4}{T}t\Bigr)&&t\in\biggl(\frac{T}{8}+k\frac{T}{2},\frac{T}{4}+k\frac{T}{2}\biggr),\,k\in\mathbf{Z}\\0&&t\in\biggl(\frac{T}{4}+k\frac{T}{2},\frac{T}{2}+k\frac{T}{2}\biggr),\,k\in\mathbf{Z}
\end{array}\right.$$
Remember that
$$c_n=\frac{1}{P}\int_{t_0}^{P+t_0}f(t)e^{-2\pi j \frac{n}{P}t}\,dt$$
In our case, P is the period (P=T/2), j is the imaginary unit, and t_0 is the initial instant (say t_0=0). Then,
$$\begin{array}{rcl}
c_n=\frac{2}{T}\int_{0}^{\frac{T}{2}}f(t)e^{-2\pi j \frac{2n}{T}t}\,dt&=&I_1+I_2+I_3
\end{array}$$
where I'll only calculate I_1 to get the idea going:
$$\begin{array}{rcl}
I_1&=&\frac{2}{T}\int_0^{\frac{T}{8}}A\sin\Bigl(\frac{8\pi}{T}t\Bigr)e^{-2\pi j\frac{2n}{T}t}\,dt\\
&=&\frac{2A}{T}\int_0^{\frac{T}{8}}\frac{e^{j\frac{8\pi}{T}t}-e^{-j\frac{8\pi}{T}t}}{2j}\cdot e^{- j\frac{4\pi n}{T}t}\,dt\\
&=&\frac{A}{jT}\int_0^{\frac{T}{8}}e^{j\frac{8\pi}{T}t}e^{-j\frac{4\pi n}{T}t}\,dt-\frac{A}{2j}\int_0^{\frac{T}{8}}e^{-j\frac{8\pi}{T}t}e^{-j\frac{4\pi n}{T}t}\,dt\\
&=&\frac{A}{jT}\Biggl( \frac{T}{8\pi-4\pi n}e^{j2\pi\frac{2-n}{T}t}\Biggr|_{0}^{\frac{T}{8}}-\frac{T}{-8\pi-4\pi n}e^{-j2\pi\frac{2+n}{T}t}\Biggr|_{0}^{\frac{T}{8}}\Biggr)\\
&=&\frac{A}{jT}\Biggl( \frac{T}{8\pi-4\pi n}(e^{j2\pi\frac{2-n}{T}\frac{T}{8}}-1)+\frac{T}{8\pi+4\pi n}(e^{-j2\pi\frac{2+n}{T}\frac{T}{8}}-1)\Biggr)\\
&=&\frac{A}{j}\Biggl( \frac{1}{8\pi-4\pi n}(e^{j\pi\frac{2-n}{4}}-1)+\frac{1}{8\pi+4\pi n}(e^{-j\pi\frac{2+n}{4}}-1)\Biggr)\\
&&\\
I_2&=&\frac{2}{T}\int_{\frac{T}{8}}^{\frac{T}{4}}-A\sin\Bigl(\frac{8\pi}{T}t\Bigr)e^{-j\frac{4\pi n}{T}t}\,dt\\
&=&...\\
&&\\
I_3&=&\frac{2}{T}\int_{\frac{T}{4}}^{\frac{T}{2}}0e^{2\pi j\frac{2n}{T}t}\,dt\\
&=&0
\end{array}$$
I believe this is all you need to get your calculations correct now... Good luck!
Best Answer
The amplitude of the spectrum of this signal is related, as all pulsed signal, with the \$sinc(t)\$ function. You must find a trigonometric relationship between the coefficient associated with the sine function
$$ \dfrac{2E}{T\,j\,n\omega} $$
and the argument of the function.
$$ n\,\omega\dfrac{\tau}{2} $$
Check out the link, and see that there is a relationship between the pulse width and frequency of the \$sinc(t)\$ function.