Evaluate the following line integral:
$$\int_l\sqrt{x^2+y^2}dl$$ where $$l:x^2+y^2=ax$$
What I've already done is: $$x^2+y^2=ax \Rightarrow \left( x-\frac{a}{2} \right)^2+y^2=\left(\frac{a}{2}\right)^2$$ Spherical coordinates: $$ \begin{cases} x-\frac{a}{2}=a \cos t \\ y=a \sin t \end{cases}$$
$$dl=\sqrt{(-a \sin t)^2+(a \cos t)^2}dt=a\space dt$$ $$\int_l\sqrt{x^2+y^2}dl=4 \int_0^{\frac{\pi}{2}} \sqrt{a^2 \cos^2{t}+a^2\cos t+\frac{a^2}{4}+a^2 \sin^2{t}} \space dt=4 a^2 \int_0^{\frac{\pi}{2}} \sqrt{\cos t+\frac{5}{4}} \space dt$$
and it seems to me that this integral doesn't have a nice answer. The answer should be $2a^2$
Your parameterization is making it very hard for you. I would recommend using straight polar coordinates. You should try that on your own before reading this solution.
Letting our path $l=r$, we then have
$$\int_l\sqrt{x^2+y^2}\,dl=\int_rr\,dr$$
Note that the path $x^2+y^2=ax$ becomes
$$r^2=ar\cos\theta$$
which gives us
$$r=a\cos\theta$$
Therefore,
$$dr=a\sin\theta\,d\theta$$
The line integral is then
$$4\int_0^{\frac{\pi}{2}}(a\cos\theta)(a\sin\theta)\,d\theta=4a^2\int_0^{\frac{\pi}{2}}\cos\theta\sin\theta\,d\theta=2a^2$$
Picking the wrong parameterization can really mess up your integrals! If it doesn't work out at first, try a different parameterization and see what happens.