#L = int sqrt((dx/(d theta))^2 + (dy/(d theta))^2 )d theta#
#L = int sqrt((d(r cos theta) /(d theta))^2 + (d(r sin theta) /(d theta))^2 )d theta#
#L= int sqrt(((dr)/(d theta))^2 + r^2) d theta#
now
#r = 2(1+cos(theta))#
so
#(dr)/(d theta) = -2 sin(theta)#
#r^2 = 4(1 + 2 cos theta + cos^2 theta)#
Adding yields
#4 sin^2 theta + 4 cos^2 theta + 4 + 8 cos theta = 8(1+ cos theta)= 16 cos^2(theta/2)#
so
#L=int 4 cos(theta/2) d theta#
#L=8 sin(theta/2)#