For the answer to the question above, I'll provide my solution below.
cos θ = x/r
r = 5 / (1 + cos θ) ==> r(1 + cos θ) = 5 ==> √(x^2 + y^2) [1 + x / √(x^2 + y^2)] = 5
√(x^2 + y^2) = 5 - x ==> x^2 + y^2 = 25 - 10x + x^2 ==> y^2 + 10x = 25
I hope my answer helped you. Have a nice day!