My understanding is that the expression for the continuous time fourier transform (CTFT) is magnitude(CTFT)exp(jw*phase), but I'm unsure how to use this expression here, since the phase is different for different values of w. I tried to do something piecewise:
from (-pi to 0): X(jw)=rect(w/(pi))*exp(pi/2*j) = j*rect(w/pi)
from (0 to pi): X(jw)=rect(w/(pi))*exp(-pi/2*j) = -j*rect(w/pi)
This doesn't agree with the answer key: X(jw)=jrect((w+pi/2)/pi) - jrect((w-pi/2)/pi).
Would appreciate any thoughts on how to better approach this problem, since I'm very confused. Thanks!
***please note, here, j is used instead of i, the imaginary number (sqrt(-1))