Find the maxima and minima of the function $$f(x,y) = x\sin(x)+\cos(x)+3y-y^3$$ under the constraint $$g(x,y)=4x^2+y^2+2y=0.$$
I have arrived at the following set of equations using the Lagrangian function: $$\begin{equation}\begin{aligned} \cos(x)&=8\lambda\\ 3-2\lambda&=2\lambda y+3y^2\\ 4x^2&=-y^2-2y \end{aligned}\end{equation}$$ There is also a hint:$$\forall x \in \left(0,\frac{\pi}{4}\right]:\quad\frac{1}{2}\sin(x)+\cos(x)\in\left(1,\frac{3}{2}\right)$$ How can I solve the equations for the possible maxima/minima?
We have $$\mathcal L(x,y,\lambda)=f(x,y)-\lambda g(x,y)=x\sin x+\cos x+3y-y^3-4\lambda x^2-\lambda y^2-2\lambda y$$ and so \begin{align}\nabla\mathcal L&=\left(\frac{\partial \mathcal L}{\partial x},\frac{\partial \mathcal L}{\partial y},\frac{\partial \mathcal L}{\partial \lambda}\right)\\&=\left(\sin x+x\cos x-\sin x-8\lambda x,3-3y^2-2\lambda y-2\lambda,-4x^2-y^2-2y\right)\\&=\boldsymbol 0.\end{align} Thus we arrive at the system \begin{align}x\cos x-8\lambda x=0&\implies x=0,\arccos8\lambda\\-3y^2-2\lambda y-2\lambda+3=0&\implies3y^2+2\lambda y+2\lambda-3=0\\&\implies (y+1)(3y+2\lambda-3)=0\\&\implies y=-1,1-\frac23\lambda\end{align} and we can check which of $$(x,y)=(0,-1),\left(0,1-\frac23\lambda\right),(\arccos8\lambda,-1),\left(\arccos8\lambda,1-\frac23\lambda\right)$$ satisfy the criterion $4x^2+y^2+2y=0$. For those that do, we can solve for $\lambda$ and hence for $(x,y)$.
Clearly $(0,-1)$ does not satisfy the constraint. For $\left(0,1-\frac23\lambda\right)$, we have $$0+y^2+2y=y(y+2)=0$$ so $(0,0)$ and $(0,-2)$ are solutions, with $\lambda=\pm\frac32$. For $(\arccos8\lambda,-1)$, we have $$4x^2+1-2=0\implies x=\arccos8\lambda=\pm\frac12$$ so $\left(-\frac12,-1\right)$ and $\left(\frac12,-1\right)$ are solutions with $\lambda=\frac18\cos\frac12$. For $\left(\arccos8\lambda,1-\frac23\lambda\right)$, we have $$4\arccos^28\lambda+\left(1-\frac23\lambda\right)^2+2-\frac43\lambda=0\implies\arccos^28\lambda=-\frac14\left(\lambda-\frac92\right)\left(\lambda-\frac32\right)$$ which has no solutions since the domain of the LHS is $\left[-\frac18,\frac18\right]$ but in this domain the RHS is negative. Therefore the only solutions are $$(0,0)_{\max},(0,-2)_{\max},\left(-\frac12,-1\right)_{\min},\left(\frac12,-1\right)_{\min}$$ since $$f(0,0)=1,\quad f(0,-2)=3,\\f\left(-\frac12,-1\right)=f\left(\frac12,-1\right)=\frac12\sin\frac12+\cos\frac12-2<0.$$