by using fourier transform equation over the limits -T/2 to T/2, you ca get the following equation
=A/2 {{ [e((j2pi(f-f0)T/2)-e((-j2pi(f-f0)T/2)]/(j2pi(f-f0)} + { [e((j2pi(f+f0)T/2)-e((-j2pi(f-f0)T/2)]/(j2pi(f+f0)}}
2 value in 2pi and T/2 gets cancelled in the exponential term, then
=A/2 {{[sin pi(f-f0)T]xT/pi(f-f0)T} + {[sin pi(f+f0)T]xT/pi(f+f0)T}
by taking T as common in the numerator term,
=AT/2 {{[sin pi(f-f0)T]/pi(f-f0)T} + {[sin pi(f+f0)T]/pi(f-f0)T}}
this is ur text book answer, there might be some mistake in your text book answer. it is showing 2pi in the final result instead of pi which is impossible.
when comes go the choice of w, the answer will e solved as
from the first eq which i mentioned, we can write the equation in the form of w as
=A/2 {{ [e((j(w-w0)T/2)-e((-j(w-w0)T/2)] x2/(2j(w-w0)} + { [e(j(w+w0)T/2)-e((-j(w+w0)T/2)]x2/(2j(w+w0)}}
by taking 2 as common in the numerator, it will get cancelled with A/2, and multiply th numerator and denominator with T/2
=A {T/2{[sin(w-w0)T/2]/T/2(w-w0)}+ {[sin(w+w0)T/2]/T/2(w+w0)}}
= AT/2 {sinc (w-w0)T/2 + sinc (w+w0)T/2}
this is ur final answer in w