Solution (source code)

= Solution

For this <parametric curve>, the <chain rule> gives
$$
\frac{dx}{dt}=-\sin t,\qquad \frac{dy}{dt}=3\cos(3t),\qquad
\boxed{\frac{dy}{dx}=-\frac{3\cos(3t)}{\sin t}.}
$$
The quotient is a finite slope when $\sin t\ne0$. At $t=0$ and $t=\pi$, the horizontal component of the tangent vanishes while the vertical component does not; these have vertical <tangent lines>, rather than missing finite values of the displayed quotient.