I have this line integral $\int_{C}(x^2+y^2)ds$, where $C=\{(x,y)|x^2+y^2=ay\}$. I tried solving it by substituting the variables as $x=r\cos{t}$ and $y=r\sin{t}$. So when I differentiate, I get $dx=-r\sin{t}$ and $dy=r\cos{t}$.
So popping this into the integral we get:
$\int_{C}((\cos{t})^2+(\sin{t})^2)*\sqrt{(-r\sin{t})^2+(r\cos{t})^2}dt$
I could probably integrate this if I knew how to apply the given circle.

If $x=r\cos t$ and $y=r\sin t$, then $x^2+y^2=r^2\ne ay$; besides, what is $r$?
Instead, since$$x^2+y^2=ay\iff x^2+\left(y-\frac a2\right)^2=\frac{a^2}4,$$you should take $x=\frac a2\cos t$ and $y=\frac a2+\frac a2\sin t$. And then you compute$$\int_0^{2\pi}\left(\frac{a^2}4\cos^2t+\frac{a^2}4(1+\sin t)^2\right)\left\|\left(-\frac a2\sin t,\frac a2\cos t\right)\right\|\,\mathrm dt.$$