Fast/smart way to write polar curve in cartesian Is there a fast way to write the curve:
$$r=\frac{a}{1-\frac{1}{\sqrt{2}}\cos(\theta)}$$
as a cartesian curve $f(x,y)=0$?
It seems I can take 
$$r(1-\frac{1}{\sqrt{2}}\cos(\theta)) = a$$
$$r-\frac{x}{\sqrt{2}}=a$$
$$\sqrt{x^2+y^2}-\frac{x}{\sqrt{2}}=a$$
$$x^2+y^2=(a+\frac{x}{\sqrt{2}})^2$$
and then expand out, and complete the square. But I seem to get an error. Perhaps there is a smart way to do this?
 A: HINT: we get
$$\sqrt{x^2+y^2}=\frac{a}{1-\frac{1}{\sqrt{2}}\frac{x}{\sqrt{x^2+y^2}}}$$
and we get by squaring
$$2(x^2+y^2)=2a^2+x^2+2\sqrt{2}ax$$
and then we have $$(x-\sqrt{2}a)^2+2y^2=2a^2$$
A: \begin{align*}
(a + \frac{x}{\sqrt{2}})^2 = a^2 + ax\sqrt{2} + \frac{x^2}{2}
\end{align*}
And then you can rewrite the equation
\begin{equation*}
\frac{x^2}{2} - ax\sqrt{2} + y^2 = a^2
\end{equation*}
as 
\begin{equation*}
    \left(  \frac{x}{\sqrt{2}} - a \right)^2 + y^2 = \left( \frac{x - a\sqrt{2}}{\sqrt{2}} \right)^2 + y^2 = 2a^2
\end{equation*}
And then you can divide through by $2a^2$ to get the equation for a shifted ellipse:
\begin{equation*}
    \frac{(x-a\sqrt{2})^2}{4a^2} + \frac{y^2}{2a^2} = 1
\end{equation*}
Unfortunately as far as I can tell there is no "smart" way to do it -- it's just crunching numbers.
A: One might recall (from the proof of Kepler's first law, for instance) that
$$ \rho(\theta) = \frac{\frac{b^2}{a}}{1+\frac{c}{a}\cos\theta} $$
is the polar equation of an ellipse (with semi-axis $b<a$ and $c=\sqrt{a^2-b^2}$) with respect to a focus. The associated cartesian equation clearly is $\frac{(x+c)^2}{a^2}+\frac{y^2}{b^2}=1$. In a similar way the cartesian equation associated to 
$$ \rho(\theta) = \frac{\frac{b^2}{a}}{1-\frac{c}{a}\cos\theta} $$
clearly is $\frac{(x-c)^2}{a^2}+\frac{y^2}{b^2}$. So, if the polar equation is $\rho(\theta)=\frac{A}{1-\frac{1}{\sqrt{2}}\cos\theta}$, we have $a^2=2b^2$ and $\frac{b^2}{a}=A$ and the cartesian equation is given by
$$ \frac{\left(x-\sqrt{2}A\right)^2}{(2A)^2}+\frac{y^2}{(\sqrt{2} A)^2}=1. $$
