I am trying find the maximum and minimum values for the absolute value or magnitude of the below function subject to the constraint $x^2 +y^2 \leq 1$: $$f(\theta, \phi, x, y) =(\alpha x+\beta y)\left(x^2 +y^2 -2(\alpha x+\beta y)^2\right)$$
Here, $\alpha = \sin \theta \cos \phi$ and $\beta =\sin \theta \sin \phi$.
My intuition:
- The minimum value is zero and it corresponds to $\alpha =\beta =0$.
- The maximum value correspond to to $\alpha= 0, \beta =1$ or $\alpha= 1, \beta =0$.
I used numerical simulations to come to this inuitions. Can someone help me formally derive this?
Let us denote $$\begin{align} &r := \sqrt{x^2 + y^2} \\ &\gamma \text{ such that }\frac{x}{\sqrt{x^2 + y^2}}= \sin(\gamma) \hspace{1cm} \text{for }\gamma\in[0,2\pi]\\ &l:=\alpha x+\beta y= \alpha \sin(\gamma)+\beta \cos(\gamma) =\sin \theta \cos \phi\sin(\gamma) + \sin \theta \sin \phi\cos(\gamma) = \sin(\theta)\sin(\gamma + \phi) \end{align}$$
From the asumptions, it's easy to notice that $r\in [0,1]$ and $l \in [-1,1]$.
then $$f(\theta, \phi, x,y) = f(\theta, \phi,\gamma, r) =f(r,l)= r^3 \cdot (l - 2l^3)$$
By studying the function $l \mapsto l - 2l^3$, it's easy to prove that it has two extrema at $l = \pm \frac{1}{\sqrt{6}}$, in the interval $l\in [-1,1]$, then: $$\underbrace{\min\left\{f\left(r,-\frac{1}{\sqrt{6}}\right),f\left(r,1\right) \right\}}_{=f(r,1)=-r^3}\le f(r,l)\le \underbrace{\max \left\{f\left(r,\frac{1}{\sqrt{6}}\right),f\left(r,-1\right) \right\}}_{=f(r,-1)=r^3}$$
We deduce that $$\color{red}{-1 \le f \le 1}$$
The equality for the minimum occurs if and only if $\cases{r = 1 \\ l = 1} \iff \color{red}{\cases{\sqrt{x^2 + y^2} = 1 \\ \sin(\theta)\sin(\gamma + \phi) = 1}} (1) $. It's not difficult to solve $(1)$ for $(\theta,\gamma,\phi)$ (there are infinitely many solutions) and then you can deduce $(x,y, \phi, \theta)$.
The equality for the maximum occurs if and only if $\cases{r = 1 \\ l = -1} \iff \color{red}{\cases{\sqrt{x^2 + y^2} = 1 \\ \sin(\theta)\sin(\gamma + \phi) = -1} }$. By the same technique, you can deduce easily $(x,y, \phi, \theta)$ corresponding.
Remark: Here is the solution for $(1)$, the first equation $(1a)$ shows that the point $(x,y)$ is on the circle $(O,1)$. The second equation $(1b)$ will precise the position of $(x,y)$ in function of $\phi$ and $\theta$: $$(1b) \iff (\theta, \phi + \gamma) =\left(\pm \frac{\pi}{2},\pm \frac{\pi}{2} \right) \iff \cases{ (\theta, \phi, \gamma) =\left(\frac{\pi}{2},\phi, \frac{\pi}{2} - \phi \right) \\ (\theta, \phi, \gamma) =\left(- \frac{\pi}{2},\phi, -\frac{\pi}{2} - \phi \right)}$$ For each value of $\phi$ and $\theta$, we can determine $1$ point $(x,y)$ on the circle $((O,1)$ corresponding.