<s>[INST] 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?
 [/INST] 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. $$
</s>