If $\rho(x, y)$ is the density of a wire (mass per unit length), then $m = \int \rho(x,y)ds$ is the mass of the wire. Find the mass of a wire having the shape of a semicircle $x = 1 + \cos(t), y = \sin(t)$, where $t$ is on the closed interval from $0$ to $\pi$, if the density at a point $P$ is directly proportional to the distance from the $y$-axis and the constant of proportionality is $3$. Round in the tenths place.
So I attempted this problem by plugging in $x$ and $y$ and then multplying it by ds to get integral from $0$ to $\pi (1+\cos t)(\sin t) \cdot \sqrt(-\sin t^2 + \cos t^2)$. Not giving me the correct answer. Any explanation is appreciated.
The distance from the $y$ axis is given by the value of $x$, so using the formula for a line integral $$\oint_C \rho\,\mathrm{d} s = \int_0^\pi \rho(x(t), y(t)) \sqrt{x'(t)^2 + y'(t)^2}\,\mathrm{d} t$$ $$= \int_0^\pi 3(1+\cos t)\,\mathrm d t$$
And now it's your job to fill in the gaps and get an answer.
(Hint: you square $x'(t)$ and $y'(t)$, so neither should be negative.)