<s>[INST] Polar equation of a circle A very long time ago in algebra/trig class we did polar equation of a circle where
$r = 2a\cos\theta + 2b\sin\theta$
Now I forgot how to derive this. So I tried using the standard form of a circle.
$$(x-a)^2 + (y - b)^2 = a^2 + b^2$$
$$(a\cos\theta - a)^2 + (b\sin\theta - b)^2 = a^2 + b^2$$
$$(a^2\cos^2 \theta + a^2 - 2a^2\cos\theta) + (b^2\sin^2 \theta + b^2 - 2b^2\sin\theta) =  a^2 + b^2$$
$$a^2\cos^2 \theta + b^2\sin^2 \theta - 2a^2 \cos\theta - 2b^2 \sin\theta = 0$$
Now I am stuck, I think I was supposed to complete the square or something. Could someone finish my thought? 
 [/INST] Although it's already been answered, it seemed like a fun way to procrastinate on my homework.
$(x-a)(x-a) + (y-b)(y-b) = aa + bb$
Substitute $x = rcos(θ)$ and $y = rsin(θ)$.
$(rcos(θ) - a)(rcos(θ) - a) + (rsin(θ) - b)(rsin(θ) - b) = aa + bb$
Multiply using FOIL.
$rrcos(θ)^2 - 2arcos(θ) + aa + rrsin(θ)^2 - 2brsin(θ) + bb = aa + bb$
Rearrange the terms.
$rrcos(θ)^2 + rrsin(θ)^2 -2arcos(θ) - 2brsin(θ) + aa + bb = aa + bb$
Factor out $r^2$.  Subtract $a^2$ from both sides. Subtract $b^2$ from both sides:
$rr(cos(θ)^2 + sin(θ)^2) -2arcos(θ) - 2brsin(θ) = 0$
Simplify left side by using the trig identity $sin(θ)^2 + cos(θ)^2 = 1$.
$rr(1) - 2arcos(θ) - 2brsin(θ) = 0$
Add $2arcos(θ)$ and $2brsin(θ)$ to both sides.
$rr(1) = 2arcos(θ) + 2brsin(θ)$
Simplify the left side.  Factor $r$ out of the right side.
$rr = r(2acos(θ) + 2bsin(θ))$
Divide both sides by $r$.
$(rr)/r = 2(acos(θ) + bsin(θ))$
Simplify the left side.
$r = 2acos(θ) + 2bsin(θ)$
</s>