Substitute #rcos(theta)# for x and #rsin(theta)# for y:
#rsin(theta) = (rsin(theta))^2 + 3(rcos(theta))^2 - rcos(theta)#
Add #rcos(theta)# to both sides:
#rsin(theta) + rcos(theta) = (rsin(theta))^2 + 3(rcos(theta))^2#
Factor out #r# and #r^2#:
#r(sin(theta) + cos(theta)) = r^2(sin^2(theta) + 3cos^2(theta))#
Pull out a #cos^2(theta)# from #3cos^2(theta)#:
#r(sin(theta) + cos(theta)) = r^2(sin^2(theta) + cos^2(theta) + 2cos^2(theta))#
Use the identity #sin^2(theta) + cos^2(theta) = 1#
#r(sin(theta) + cos(theta)) = r^2(1 + 2cos^2(theta))#
Divide both sides by #r(1 + 2cos^2(theta))#:
#r = (sin(theta) + cos(theta))/(1 + 2cos^2(theta))#