# How to prove the maximum of n-dimensional linear function $a^Tx$ is $||a||_2$ for $||x||_2 \le 1$

I can get it when $x \in \mathbb R$, but I cannot understand why

$$\sup\{a^Tx \mid \|x\|_2 \le 1 \} = \| a \|_2$$ when $x \in \mathbb R^n$. To my understanding, this problem can be transformed into a Second Order Cone Programming (SOCP) problem:

$$\begin{array}{ll} \text{minimize} & -a^T x\\ \text{subject to} & \| x \|_2 \le 1\end{array}$$

• In fact, this problem helps me thread derivation of dual norm and Holder inequality, that's great! :) – Finley Sep 5 '17 at 13:34

By Cauchy-Schwartz inequality, you have

$$a^Tx\leq \|a\|_2\|x\|_2\leq \|a\|_2.$$ Now note that for $x=\frac{1}{\|a\|_2}a,$ the equality holds.

You could also use Lagrange multipliers to find the solution, and it is a general method, but this way seems faster.

We can assume that $a \ne 0$. By Cauchy-Schwarz:

$a^Tx \le ||a||_2||x||_2 \le ||a||_2$ for all $x$ with $||x||_2 \le 1$.

Now let $x=\frac{1}{||a||_2}a$. Then we have: $a^Tx=||a||_2$