<s>[INST] Calculate the line intergal: $A=\int_C \sqrt{x^2+y^2}ds$ Calculate the line intergal:
$$A=\int_C \sqrt{x^2+y^2}ds, \, \text{with} \,\,  C: x^2+y^2=ax$$
Set $\left\{\begin{align*}   
x&=\dfrac{a}{2}\left( \dfrac{a}{2}+\cos t\right)\\[10pt]
y&=\dfrac{a}{2}sint
\end{align*}\right., \quad 0 \leq t \leq 2\pi$
So, $$\begin{align*} 
D&=\displaystyle \int_0^{2\pi}\left( \dfrac{a}{2}\right)^2\sqrt{\left( \dfrac{a}{2}+\cos t\right)^2+\sin^2t}.\sqrt{\sin^2  t + \cos^2 t}\, dt\\[10pt]
&=\dfrac{a^2}{4} \displaystyle \int_0^{2\pi} \sqrt{a\cos t+1+\dfrac{a^2}{4}}\,dt
\end{align*}$$
I have a trouble with this integral. It's not easy to calculate. Help me!
 [/INST] $C: x^2+y^2=ax \implies \left(x - \dfrac{a}{2}\right)^2 + y^2 = \dfrac{a^2}{4}$
So parametrize as $r(t) = \left(\dfrac{a}{2} + \dfrac{a}{2} \cos t, \dfrac{a}{2} \sin t \right), 0 \leq t \leq 2\pi$
$|r'(t)| = \sqrt{\left( - \dfrac{a}{2}\sin t\right)^2 + \left( \dfrac{a}{2}\cos t\right)^2} = \dfrac{a}{2}$
$\sqrt{x^2+y^2} = \sqrt{ax}  = \dfrac{a}{\sqrt2} \sqrt{1 + \cos t}$
So the integral is,
$I = \displaystyle \dfrac{a^2}{2\sqrt2} \int_0^{2\pi} \sqrt{1 + \cos t} \ dt = 2a^2$
Edit: there is another parametrization you can use as the circle is centered on x-axis and y-axis is tangent to it,
In polar coordinates, $x = \rho \cos t, y = \rho \sin t$ and so $x^2 + y^2 = ax \implies \rho = a \cos t$ and as we are measuring the angle from origin, the circle forms for $- \pi/2 \leq t \leq \pi/2$.
$x = \rho \cos t = a \cos^2 t, y = \rho \sin t = a \sin t \cos t$
So we have, $r(t) = (a \cos^2 t, a \sin t \cos t), - \pi/2 \leq t \leq \pi/2$
$r'(t) = (- a \sin 2t, a \cos 2t), |r'(t) = a$
$\sqrt{x^2+y^2} = a \cos t$
The integral becomes,
$I = \displaystyle a^2 \int_{-\pi/2}^{\pi/2} \cos t \ dt = 2a^2$
</s>