Trefoil knot as an algebraic curve

Consider two relatively prime integers $p,q \geq 2$ and the complex affine curve $C\subset \mathbb C^2 $given by $x^p+y^q=0$, which has an isolated singularity at the origin $O=(0,0)$.

If $C$ is intersected with the real $3$-sphere $S_\epsilon$ of equation $\mid x\mid ^2+\mid y \mid^2=\epsilon ^2$, Brauner proved in 1928 that the resulting real algebraic curve $C\cap S_\epsilon$ is a $(p,q)$ knot.
For $p=2, q=3$ , you obtain the trefoil knot, as you correctly conjectured.

Milnor has written a fantastic booklet (122 pages...) on the subject: Singular points of complex hypersurfaces, published by Princeton in 1968, with Brauner's theorem proved on the second page!

Edit
The intersection $C\cap S_\epsilon\subset \mathbb C^2=\mathbb R^4$ is a real algebraic curve with completely explicit polynomial equations .
For the trefoil knot with $p=2,q=3 $ for example, we get (writing $x=x_1+ix_2, y=y_1+iy_2$)
$$ x_1^2+x_2^2+y_1^2+y_2^2=\epsilon^2, \quad x_1^2-x_2^2+y_1^3-3y_1y^2_2=0,\quad 2x_1x_2+3y_1^2y_2-y_2^3=0 $$


I know I am a bit late, but I think it is pretty easy to see that the trefoil can be described in terms of algebraic equations. Consider the parametrization from Wikipedia: $$ x = \sin t + 2 \sin 2t, \quad y=\cos t - 2 \cos 2t, \quad z=-\sin 3t. $$ Using the rules for double and triple angle this is equal to $$ x = \sin t + 4 \sin t\cos t, \quad y=\cos t - 2 +4\sin^2 t, \quad z=-\sin t (4\cos^2 t -1). $$ Denoting $s=\sin t$ and $c=\cos t$ you have the ideal $$ I=\langle s + 4 sc-x,c - 2 +4s-y,-s (4c -1)-z,s^2+c^2-1\rangle $$ describing the trefoil. The equation $s^2+c^2-1=0$ makes the connection between $\sin t$ and $\cos t$ while eliminating the parameter $t$. Now you can eliminate $s$ and $c$ in order to obtain a representation in the variables $x,y$ and $z$. Here is the SINGULAR code:

ring R = 0,(x,y,z,s,c),dp;
ideal I = 4*s*c-x+s, 4*s^2-y+c-2, -4*s*c^2-z+s, s^2+c^2-1;
ideal J = eliminate(I,sc);

Now $J=\langle P_1,P_2,P_3,P_4,P_5,P_6\rangle$ with $$ \begin{aligned} P_1&=12x^2y-4y^3-13x^2-13y^2+64z^2+9,\\ P_2&=x^3-3xy^2+4x^2z+4y^2z-9z,\\ P_3&=64y^3z+9x^3+9xy^2+4x^2z+100y^2z-192xz^2\\ &\phantom{=}-256z^3-72xy-180yz+27x-36z,\\ P_4&=256xy^2z-256x^2z^2-256y^2z^2-16y^3-128xyz\\ &\phantom{=}+256yz^2+35x^2-61y^2-240xz+640z^2-36y+9,\\ P_5&=48y^4+112y^3-144xyz-192yz^2-35x^2\\ &\phantom{=}-143y^2-108xz-160z^2-108y+99,\\ P_6&=8xy^3-4x^3+8xy^2-24x^2z-32xz^2-18xy-18yz+9x+27z. \end{aligned} $$ Maybe there are also generators with smaller degree. I haven't tried to find them yet.

There is also the famous trick to generate a single equation for the space curve: $$ T=\sum_{i=1}^6 P_i^2. $$ Over the real numbers you have $V_\mathbb{R}(J)=V_\mathbb{R}(T)$.

I'd like to post an image of a visualization based on the algebraic equations. But unfortunately, I don't have enough reputation yet.

Edit: Now I have enough reputation to post an image:

enter image description here


Another answer to this question, based on ideas from my answer here. I will write a trefoil knot as the transverse intersection of two smooth polynomial surfaces. I will also draw pictures!

Here is the basic idea. Let $S^3$ be the sphere $|z_1|^2 + |z_2|^2 = 2$ inside $\mathbb{C}^2$. I'll write each coordinate $z_j$ as $x_j+i y_j$. The trefoil knot $K$ is given by the equation $z_1^3 = z_2^2$ in $S^2$. Taking real and imaginary parts, we get $$x_1^3 - 3 x_1^2 y_1 = x_2^2 - y_2^2 \qquad 3 x_1^2 y_1 - y_1^3 = 2 x_2 y_2. \qquad (1)$$ I compute in my linked answer that these give smooth, transverse, surfaces in $S^3$.

That's $S^3$, but the OP asked for $\mathbb{R}^3$. To this end, we can remove a point from $S^3$. Since the OP wants a closed knot, not one that goes off to infinity, we should remove a point not on $K$. It is also good to remove a point where $z_1^3-z_2^2$ is neither purely real nor purely imaginary, so the two surfaces in $(1)$ will stay compact. I choose the point $(1+i, 0)$.

Stereographic projection away from the point $(1+i, 0)$ is given by the formula $$(u,v,w) \ = \ \frac{1}{2-x_1-y_1} (x_1-y_1, x_2, y_2) \qquad (2).$$ Composing $(2)$ with the parametrization $(e^{2 i t}, e^{3 i t})$ of $K$, we get a knot in $\mathbb{R}^3$ parametrized as $$\left( \frac{\cos (2 t) - \sin(2 t)}{2-\sin (2 t)-\cos (2 t)},\ \frac{\cos (3 t)}{2-\sin (2 t)-\cos (2 t)},\ \frac{\sin (3 t)}{2-\sin (2 t)-\cos(2 t)}\right).$$

Rotating image of trefoil knot

To get equations for the surfaces in $(1)$, we need to have the inverse of $(2)$. That's easy to compute; the inverse map is $$(x_1, y_1, x_2, y_2) = $$ $$\frac{1}{u^2+2 v^2+2 w^2+1} \left( u^2+2 u+2 v^2+2 w^2-1,\ u^2-2 u+2 v^2+2 w^2-1,\ 4v,\ 4 w \right). $$ Plugging this into $(1)$ and putting everything over a common denominator, we get the equations $$2 + 12 u - 30 u^2 - 40 u^3 + 30 u^4 + 12 u^5 - 2 u^6 - 28 v^2 - 48 u v^2 + 56 u^2 v^2 + 48 u^3 v^2 - 12 u^4 v^2 - 8 v^4 + 48 u v^4 - 24 u^2 v^4 - 16 v^6 + 4 w^2 - 48 u w^2 + 88 u^2 w^2 + 48 u^3 w^2 - 12 u^4 w^2 + 48 v^2 w^2 + 96 u v^2 w^2 - 48 u^2 v^2 w^2 - 48 v^4 w^2 + 56 w^4 + 48 u w^4 - 24 u^2 w^4 - 48 v^2 w^4 - 16 w^6 =$$ $$-2 + 12 u + 30 u^2 - 40 u^3 - 30 u^4 + 12 u^5 + 2 u^6 + 12 v^2 - 48 u v^2 - 72 u^2 v^2 + 48 u^3 v^2 + 12 u^4 v^2 - 24 v^4 + 48 u v^4 + 24 u^2 v^4 + 16 v^6 - 32 v w - 32 u^2 v w - 64 v^3 w + 12 w^2 - 48 u w^2 - 72 u^2 w^2 + 48 u^3 w^2 + 12 u^4 w^2 - 48 v^2 w^2 + 96 u v^2 w^2 + 48 u^2 v^2 w^2 + 48 v^4 w^2 - 64 v w^3 - 24 w^4 + 48 u w^4 + 24 u^2 w^4 + 48 v^2 w^4 + 16 w^6=0$$ for $K$.

Here is the first equation, together with the knot. (Apologies for the gaps in the knot; I spent a while fighting with Mathematica and I want to go to bed. And thanks to this answer for getting me this far!)

surface and knot

And here are the two surfaces together. It's hard for me to actually see this, but it is two genus two surfaces, meeting along the knot.

enter image description here

As a final note, I spent a long time trying to get $K$ as the intersection of a genus $1$ surface with something, since $K$ is, after all, a torus knot. It took me a while to understand why I was failing: If $K$ is to be the transverse intersection of $T$ and $\{ f=0 \}$, then I want $f$ restricted to $T$ to be positive on one side of $K$ and negative on the other. But, if I embed $K$ into a torus $T$, then $K$ will not disconnect $T$, so this is impossible. The knot $K$ does disconnect the genus $2$ surfaces in the pictures, which is why I succeed.