With a given point $(p,q)$, I'm trying to find the nearest point on a curve $g$ to the point. So for $g(x,y)=x^2+y^2=1$, easy enough, the point would just be the solution of this system of equation where $f$ is $(x-p)^2+(y-q)^2$:
$$ \left\{ \begin{array}{ll} \nabla f=\lambda \nabla g\\ g=0\\ \end{array} \right. $$
which is $\bigg(\frac{p}{\sqrt{p^2+q^2}},\frac{q}{\sqrt{p^2+q^2}}\bigg)$. However, I decided to see what would happen if I change the curve to $x^3+y^2=1$. So using LaGrange multipliers again, replacing $x$s and $y$s with $\lambda$, I ended up with this equation
$$ \bigg(\pm\frac{\sqrt{1-6\lambda p}-1}{3\lambda}\bigg)^3+\bigg(\frac{q}{1-\lambda}\bigg)^2=1 $$
but now I'm stuck. Any help would be appreciated.