1. The problem statement, all variables and given/known data

Find the expression for theEfield at an arbitrary point in space due to a straight line of length l uniformly charged with total charge Q. The ambient medium is air.

2. Relevant equations

3. The attempt at a solution

I am following this example with the solution given in my textbook and I am confused about one part.

He somehow makes the following transition,

$\displaystyle \vec{E} = \frac{1}{4 \pi \epsilon_{0}} \int_{l} \frac{Q^{'}dl}{R^{2}}\hat{R} = \frac{Q}{4\pi \epsilon_{0} ld} \int_{\theta_{1}} ^{\theta_{2}} \left( cos\theta \hat{i} - sin\theta \hat{k} \right)d\theta$

Where does the ld in the denominator come from?

From trig relationships it can be shown that,

$\displaystyle \frac{1}{R^{2}} = \frac{d\theta}{dz} \frac{1}{d}$

which accounts for the d in the denominator, but where does the l come from? Is it that,

$\displaystyle l = \frac{dz}{d\theta}$?

And if so, why? (That doesn't make any sense to me)

Also, where does he get $\displaystyle \hat{R} = cos\theta \hat{i} - sin\theta \hat{k}$? Where does this come from?

Also, he mentions that $\displaystyle \theta$ ranges from $\displaystyle \theta_{1}$ to $\displaystyle \theta_{2}$, but $\displaystyle \theta_{1}$ is moving counterclockwise fashion, so shouldn't we conclude $\displaystyle \theta_{1} > 0$ and for $\displaystyle \theta_{2}$ moving in a clockwise fashion, $\displaystyle \theta_{2} < 0$? In his solution he has this reversed, so what am I mixing up?