How to derive the polar equation of a circle. 
I have learnt that the standard equation of a circle whose centre is at (a,b) is
$$(x-a)^2 + (y-b)^2 = c^2
$$
I am trying to derive the polar equation of this circle but I am unfortunately stuck.
$$\begin{align}(x-a)^2+(y-b)^2&=c^2\\
(r\cos\theta-a)^2+(r\sin\theta-b)^2&=c^2\\
r^2\cos^2\theta-2ra\cos\theta+a^2+r^2\sin^2\theta-2rb\sin\theta+b^2&=c^2\\
r(r-2a\cos\theta-2b\sin\theta)&=c^2-a^2-b^2\end{align}$$
The following is stated in James Stewart's book on Precalculus but there is no proof stated in this book. So I am trying to reach a similar result by beginning at the standard equation of a circle.

 A: What you have done is fine for the equation of a general circle.  You would then use the quadratic formula to solve for $r.$  The result may look messy, but prettiness is not guaranteed.
You could make the simplification: $2a\cos \theta + 2b\sin \theta = 2\sqrt{a^2+b^2}\cos (\theta - \arctan\frac ba)$
Then you can give say $d=\sqrt{a^2+b^2}$ and $\phi = \arctan \frac ba$
To get to the equations from the book, this is a circle of radius $a$ centered at $(a,0)$ or $(0,a).$  Let's make the circle centered at $(a,0).$
Then $c = a$ and $b=0$
Plugging those values into your last line:
$r(r-2a\cos \theta) = 0$
Supposing $r\ne 0$
$r = 2a\cos\theta$ as desired.
A: You got off to a good start: Just plug in $x = r \cos\theta$ and $y = r \sin\theta$ in the standard rectangular-coordinate equation $(x-a)^2 + (y-b)^2 = c^2$
$$(r \cos\theta-a)^2 + (r \sin\theta-b)^2 = c^2$$
Or, if you need the equation expressed as a polynomial of $r$,
$$r^2 \cos^2\theta - 2ar\cos\theta + a^2 + r^2\sin^2\theta - 2br\sin\theta + b^2 = c^2$$
$$r^2(\cos^2\theta + \sin^2\theta) - 2r(a\cos\theta + b\sin\theta) + a^2 + b^2 - c^2 = 0$$
$$r^2 - 2(a\cos\theta + b\sin\theta)r + (a^2 + b^2 - c^2) = 0$$
Or, if you need to have an explicit formula for $r$ in terms of $\theta$, just use the Quadratic Formula,
$$r = \frac{2(a\cos\theta + b\sin\theta) \pm \sqrt{4(a\cos\theta + b\sin\theta)^2 - 4(a^2 + b^2 - c^2)}}{2}$$
$$r = \frac{2a\cos\theta + 2b\sin\theta \pm \sqrt{4a^2\cos^2\theta + 8ab\cos\theta\sin\theta+4b^2\sin^2\theta - 4a^2 - 4b^2 + 4c^2}}{2}$$
$$r = \frac{2a\cos\theta + 2b\sin\theta \pm 2 \sqrt{a^2(\cos^2\theta - 1) + 2ab\cos\theta\sin\theta+b^2(\sin^2\theta - 1) + c^2}}{2}$$
$$r = a\cos\theta + b\sin\theta \pm \sqrt{a^2(-\sin^2\theta) + 2ab\cos\theta\sin\theta+b^2(-\cos^2\theta) + c^2}$$
$$r = a\cos\theta + b\sin\theta \pm \sqrt{c^2 - (a\sin\theta - b\cos\theta)^2}$$
A: The polar equation for a circle is given in the form $r=r(\theta)$ and in this case

*

*for the circle with radius $|a|$ centered at $(a, \pi/2)$ we have

$$r = 2 \cdot a\cdot \cos (\pi/2 -\theta) = 2a \sin \theta$$
and similarly

*

*for the circle with radius $|a|$ centered at $(a, 0)$ we have

$$r =  2a \cos \theta$$

A: By to reach a similar result I understood that you are interested in an unparametrized form.
We obtain polar equation by continuing the derivation to its  logical conclusion.
$$ r(r-2a\cos\theta-2b\sin\theta)=c^2-a^2-b^2$$
Distance to center from origin   $OC=\sqrt {a^2+b^2}$ and power of circle /squared tangent length
$$ a^2+b^2-c^2= OT^2=T^2 $$
$$ = r(r- 2a \cos\theta-2b \sin\theta)=OT^2$$
$$ = r(r- 2  \sqrt {a^2+b^2}\cdot ( \frac{a}{\sqrt {a^2+b^2}}\cos \theta +  \frac{b}{\sqrt {a^2+b^2}}\sin \theta) )$$
$$ \alpha=\angle COx= \tan^{-1}\frac{b}{a}, \;\theta=\angle AOx\;$$

$$ =r(r- 2  \sqrt {a^2+b^2}( \cos\alpha \cos \theta +  \sin \alpha\sin \theta) )$$
$$OT^2= r\left(r- 2  \sqrt {a^2+b^2} \cos(\alpha- \theta)\right) \tag 1 $$
This can be readily recognized as the property of circle with a constant product of segments made by intersecting chords. Drop perpendicular CM onto OA. M is mid-point of AB, OMC is a right triangle
$$OM=\frac{OA+OB}{2}= OC \cos (\alpha-\theta)$$
$$ OA=r, OB=r- 2\sqrt{a^2+b^2}\cos (\alpha-\theta)= r- 2 Q $$
$$Q=\sqrt{a^2+b^2}\cos (\alpha-\theta) $$
$$ OA\cdot OB=T^2 \;, r(r-2Q)=OT^2;\;\tag 2 $$
Solving the quadratic we obtain
$$ r= Q\pm\sqrt{Q^2-T^2} $$
The radius vector intersects a circle at two points $(A,B)$. Finally the required polar coordinate equations are
$$ r= \sqrt{a^2+b^2}\cos (\alpha-\theta) \pm \sqrt{c^2-(a^2+b^2)\sin^2 (\theta-\alpha)} \tag 3 $$
Positive sign for outer part, negative sign for inner part and radicals disappear at tangent point $r=T.$
It can be verified by trigonometry for any Circle radius $c$ centered at $(a,b)$  the radius  must always be  $r=T $ at point of tangency.I.e.,
$$ @\; \theta = \tan^{-1}\frac{b}{a} \pm \sin^{-1}\frac{c}{\sqrt{a^2+b^2}}, \; r=T\; \text{ always}$$
Extreme radii $ \; @ \theta= \alpha\; $ are
$$ \sqrt{a^2+b^2}\pm c $$
All the details are shown in the graph drawn for assumed constants
$$(a,b,c)=(4,3,2), r_{max}=7, r_{min}=3, T=\sqrt{21}\approx 4.5826 $$
A Cartesian $(r-\theta)$ plot is also given for a distorted circle in an alternate coordinate representation, as we are more familiar using Cartesian coordinates. It may be ignored at first reading, it is intended to identify four cardinal points.. ( two extreme radii, two points of tangency).
As an exercise you can make the necessary change for a negative power eccentric circle.
Actually I hope it is not the " general" polar equation given in the text-book. It pertains only to two particular cases when the circles pass through the origin, when centered on $(x,y)$ axes, $r_{min}=0 $ but is not about general eccentric circles placed in arbitrary quadrants.
A: As already noticed, in Stewart's solutions $\theta$ is the angle from the origin while you are considering the angle from the center of the circle. Moreover in Stewart $(a,0)$ and $(a,\pi/2)$ represent polar coordinates of the center and not cartesian coordinates. Stewart's particular solutions described in your question can indeed be easily determined by simple geometrical considerations, as already shown in the previuos answer.
In general, a convenient way to obtain a polar parametric form for the circle centered at $(a,b)$ (cartesian) with radius $c$ ($>0$) is to parametrize with respect to the angle $\alpha$ with respect to the center of the circle, according to the following sketch

we obtain
$$\begin{cases}
r(\alpha)= \sqrt{(a+c\cos \alpha)^2+(b+c\sin \alpha)^2}=\sqrt{a^2+b^2+c^2+2ac\cos \alpha + 2bc \sin \alpha}\\\\
\theta (\alpha)=\operatorname{atan2}\left(b+c\sin \alpha, a+c\cos \alpha\right)
\end{cases}$$
where $\alpha \in [0,2\pi)$ and atan2 is the 2-argument arctangent function.
