In this problem I am trying to find $E_{x}$(the electric field of at the origin). So far I have the following:
$dE_{x} = -k\frac{dq}{a^2}cos(\theta).$ This is the basic componet of the electric field in the x-direction.
Knowing the charge density is: $\lambda =\frac{Q}{L}$ and $\lambda = \frac{dq}{d\theta}$
So by doing a little algebra I get: $\lambda \cdot d\theta = dq$.
Subbing things in: $E_{x} = -\int \frac{k\lambda}{a^2}cos(\theta)d\theta$.
Above is where I am stuck. The solution is: $-\int_{0}^{\frac{\pi}{2}} \frac{\lambda cos(\theta)k}{a}d\theta$.
What substitutions am I failing at? I don't really understand how they got there...

The charge is uniformly distributed in the wire. The wire is a circular arc. A circle has circumference $2\pi r= 2\pi a$. We only want a quarter of it, so $\pi a/2$. Then the charge density is $$ \lambda= \dfrac{q}{\frac{\pi}{2} r}= -2.9 \cdot 10^{-6} $$ But then $dq= \lambda \;ds= \lambda R d\theta$. Then we have $$ E_x= - \int_0^{\pi/2} \dfrac{k\cos \theta}{R^2} \;dq= - \int_0^{\pi/2} \dfrac{k\lambda R\cos \theta}{R^2} \;d\theta= - \int_0^{\pi/2} \dfrac{k\lambda \cos \theta}{R} \;d\theta $$