Extreme values of function with one condition What is the simple way to find extreme values of a function $f(x,y) = 5*x^2 + 3*x*y + y^2$ with conditions $x^2 + y^2 = 1$.
I tried to make partial derivatives and initialize them with $0$, but the result is not good.
 A: As araomis's comment suggested, you can try using polar co-ordinates with $r = 1$. This is because the unit circle $x^2 + y^2 = 1$ can be parametrized by $x = \cos(\theta)$ and $y = \sin(\theta)$ for $\theta \in [0,2\pi)$. Using this, along with the unit circle, then
$$f(x,y) = 5x^2 + 3xy + y^2 = 4x^2 + 3xy + 1 \tag{1}\label{eq1}$$
becomes
$$g(\theta) = f(\cos(\theta),\sin(\theta)) = 4\cos^2(\theta) + 3\cos(\theta)\sin(\theta) + 1 \tag{2}\label{eq2}$$
Wikipedia's List of trigonometric identities includes several useful identities. These include $\sin(2\theta) = 2\sin(\theta)\cos(\theta)$ so
$$3\cos(\theta)\sin(\theta) = \frac{3}{2}\sin(2\theta) \tag{3}\label{eq3}$$
Also, $2\cos^2(\theta) = 1 + \cos(2\theta)$ so
$$4\cos^2(\theta) = 2 + 2\cos(2\theta) \tag{4}\label{eq4}$$
\eqref{eq3} and \eqref{eq4} in \eqref{eq2} gives
$$g(\theta) = 2\cos(2\theta) + \frac{3}{2}\sin(2\theta) + 3 \tag{5}\label{eq5}$$
Finally, the Sine and Cosine sub-section gives that $a\sin x+b\cos x=c\sin(x+\varphi)$ where $c = \sqrt{a^2 + b^2}$ and $\varphi = \text{atan2}(b,a)$. In this case, $x = 2\theta$, $a = \frac{3}{2}$ and $b = 2$, so
$$c = \sqrt{\frac{9}{4} + 4} = \frac{5}{2} \tag{6}\label{eq6}$$
Note there's no need to calculate $\varphi$ as it's just a fixed offset $\in (-\pi,\pi]$. Thus, \eqref{eq5} can be rewritten as
$$g(\theta) = \frac{5}{2}\sin(2\theta + \varphi) + 3 \tag{7}\label{eq7}$$
Since $-1 \le \sin(2\theta + \varphi) \le 1$, the minimum value of $g(\theta) = f(x,y)$ is $3 - \frac{5}{2} = \frac{1}{2}$ (when $2\theta + \varphi = -\frac{\pi}{2}, \frac{3\pi}{2} \; \text{and/or} \; \frac{7\pi}{2}$) and the maximum value is $3 + \frac{5}{2} = \frac{11}{2}$ (when $2\theta + \varphi = \frac{\pi}{2}, \frac{5\pi}{2} \; \text{and/or} \; \frac{9\pi}{2}$).
A: This is a homogeneous system so making $y = \lambda x$ we have the equivalent problem
$$
\min\max f(\lambda,x) = x^2(5+3\lambda +\lambda^2)\ \ \text{s. t.}\ \ x^2(1+\lambda^2) = 1
$$
or equivalently
$$
\min\max g(\lambda) = \frac{5+3\lambda +\lambda^2}{1+\lambda^2}
$$
so calculating the solutions for $g'(\lambda) = 3-8\lambda-3\lambda^2 = 0$ we have $\lambda = (-3,\frac 13)$ then
$$
\frac 12\le g(\lambda) \le \frac{11}{2}
$$
