Optimize over unit circle to prove $|ax + by| \le \sqrt{a^2 + b^2}$ I have the following problem which, straight off the shelf, seems totally approachable.  It's been giving me difficulty however: 

Let $a,b,x,y \in \mathbb{R}$, and suppose that $x^2 + y^2 =1$. Prove that $|ax + by| \le \sqrt{a^2 + b^2}$.

I have started by considering the function $f(x,y) = ax + by$, and by defining a constraint function $g(x,y) = x^2 + y^2$. Then if I can maximize and minimize $f(x,y)$ subject to the constraint $g(x,y) = 1$, I should be done. By both methods (the method of Lagrange multipliers, and the method of evaluating $f(x,y)$ on the unit circle, finding critical points, etc.) I am having difficulties. 
For the Lagrange multiplier method, we know that we will maximize/minimize $f(x,y)$ subject to the constraint $g(x,y) = 1$ if the system $\nabla g = \lambda \nabla f$, $g(x,y) = 1$ is satisfied. In terms of our particular example, we obtain the system of three equations
\begin{align*}
2 \lambda x &= a\\
2 \lambda y &= b\\  
x^2 + y^2 &=1.
\end{align*}
I'm not sure how to solve this system. I considered using the function $h(x,y) = (f(x,y))^2 = (ax + by)^2$ instead of $f$, but then things don't work out nicely for the minimum values of $f(x,y)$ and $h(x,y)$.
For the other method, I'm even less sure of what I'm doing.  Any help would be greatly appreciated.  
 A: First of all, there is a fairly easy way to show this inequality:
$$|ax + by| = |(a, b)\cdot (x, y)| \leq \|(a, b)\|\|(x, y)\|\cos\theta \leq \|(a, b)\|\|(x, y)\| = \|(a, b)\| = \sqrt{a^2 + b^2}.$$
As for the Lagrange multipliers method, you're almost there. As $2\lambda x = a$ and $2\lambda y = b$, $x = \frac{a}{2\lambda}$ and $y = \frac{b}{2\lambda}$. To determine the values of $\lambda$, we use the fact that $g(x, y) = 1$. Using this, we have
$$1 = g(x, y) = x^2 + y^2 = \left(\frac{a}{2\lambda}\right)^2 + \left(\frac{b}{2\lambda}\right)^2 = \frac{a^2+b^2}{4\lambda^2}$$
so $\lambda = \pm\frac{1}{2}\sqrt{a^2+b^2}$. 
If $\lambda = \frac{1}{2}\sqrt{a^2+b^2}$ then $(x, y) = \left(\frac{a}{\sqrt{a^2+b^2}}, \frac{b}{\sqrt{a^2+b^2}}\right)$, and $f(x, y) = \sqrt{a^2+b^2}$.
If $\lambda = -\frac{1}{2}\sqrt{a^2+b^2}$ then $(x, y) = \left(-\frac{a}{\sqrt{a^2+b^2}}, -\frac{b}{\sqrt{a^2+b^2}}\right)$, and $f(x, y) = -\sqrt{a^2+b^2}$.
So $f$ has attains it maximum value of $\sqrt{a^2+b^2}$ at the first point and a minimum value of $-\sqrt{a^2+b^2}$ at the second point. Therefore, for all $(x, y)$ on the unit circle, 
$$-\sqrt{a^2+b^2} \leq f(x, y) \leq \sqrt{a^2+b^2}.$$ 
So $|ax+by| = |f(x, y)| \leq \sqrt{a^2+b^2}$.
A: working backwards gives by squaring $$a^2x^2+b^2y^2+2abxy\le a^2+b^2$$ this is equivalent to $$2abxy\le a^2(1-x^2)+b^2(1-y^2)$$ or $$2abxy\le a^2y^2+b^2x^2$$ and this is $$0\le (ay-bx)^2$$ which is true.
A: For the other method, parametrize the circle by $x=\cos t$ and $y=\sin t$. Then 
$$
ax+by=a\cos t+ b\sin t=\sqrt{a^2+b^2}\sin(t+\phi)
$$
for some $\phi$ (you should be able to check this). Maybe you can continue from here?
A: can we do this. we will show that you can write $$ ax + by = \sqrt{a^2 + b^2}\cos(t - \phi)$$ which will give us the inequality $$ |ax + by| \le \sqrt{a^2 + b^2}$$ 
 here is an outline:
since $x^2 + y^2 = 1,$ there is $t$ such that $x = \cos t, y = \sin t$ and 
$ax + by = \sqrt{a^2 + b^2}\left(\dfrac{a}{\sqrt{a^2+b^2}} \cos t + \dfrac{b}{\sqrt{a^2+b^2}} \sin t\right) = \sqrt{a^2 + b^2}\cos(t-\phi)$ where $\phi$ is determined by $ \cos \phi = \dfrac{a}{\sqrt{a^2+b^2}}, \ \sin \phi =  \dfrac{a}{\sqrt{a^2+b^2}}$ 
A: Your approach is reasonable.
Let $f((x,y)) = |ax+by|$, $g((x,y)) = {1 \over 2}(x^2+y^2)$, solve $\max \{f((x,y))|  g((x,y))  = {1 \over 2} \}$.
The constraint $g((x,y))  = {1 \over 2} $ shows that the feasible set is compact, so we know a maximum exists.
Note that if $a=b=0$, then the result is true, so suppose $(a,b) \neq 0$.
If $(a,b) \neq 0$, choosing $(x,y) = {1 \over \sqrt{a^2+b^2}} (a,b)$ shows that $ax+by = \sqrt{a^2+b^2} >0$, so the problem is equivalent to
solving
$\max \{ ax+by|  g((x,y))  = {1 \over 2} \}$. The point here is that I 
can remove the $|\cdot|$.
Noting that the gradient of the constraint is never zero, we use Lagrange multipliers to get
$\begin{bmatrix} a \\ b \end{bmatrix} + \lambda \begin{bmatrix} x \\ y \end{bmatrix} = 0$. Note that $\lambda \neq 0$ since $(a,b) \neq 0$.
This gives $x = { a \over \lambda }$, $y = { b \over \lambda }$, and
using the constraint $g((x,y)) = {1 \over 2}$ shows that
$\lambda = \pm\sqrt{a^2+b^2}$. Checking shows that both values of
$\lambda$ are solutions.
Hence the solutions are
$(x,y) = \pm{1 \over \sqrt{a^2+b^2}} (a,b)$.
Alternative approach:
The problem can be written in the form
$\max \{ |\langle c , x \rangle | \mid \|x\| = 1 \}$, where $c,x \in \mathbb{R}^n$.
We can write any $x= \alpha {c \over \|c\|} + v$, where $v \bot c$, and it 
is easy to check that $\|x\|^2 = \alpha^2 + \|v\|^2$. Hence we
can write the problem as
$\max \{  |\alpha| \|c\| \mid \alpha^2 + \|v\|^2 = 1, v \bot c \} $.
It is straightforward to see that $\alpha = 1, v=0$ solves the problem,
so the maximum is $\|c\|$ and is attained at $x={c \over \|c\|}$.
(Note: This proves the Cauchy-Schwarz inequality on $\mathbb{R}^n$ since
we have $|\langle c,d \rangle| = \|d\| |\langle c,{d \over \|d\|} \rangle| \le \|d\| \|c\|$.)
