How do you integrate imaginary numbers?

Yes nothing special. If $f$ and $g$ are real functions then $\int (f + i g) = \int f + i \int g$.


Nothing special for situations like this, but if, for example, you're integrating $(1/x)\;dx$ not along the line from $0$ to $4$, but along a circle that winds once counterclockwise around $0$, then you may need something more sophisticated.


You can treat $i$ as a constant:

$$\int_0^4 ix dx = i\int_0^4 xdx = i[x^2/2]_0^4 = i(8-0) = 8i$$