Dot Product Maximization with Norm and Coefficient Constraints Let $a,b,x\in\mathbb{R^n}$ where $a$ and $b$ are constant. We wish to find a value of $x$ so that,

*

*$a^T \cdot x = 0$

*$\lVert x \rVert = 1$

*$b^T \cdot x$ is maximized given the previous constraints

Solutions which solve a relaxed version of this optimization problem are also of interest.
 A: Let $y$ denote the component of $b$ orthogonal to $a$, i.e. the vector
$$
y = b - \frac{b^Ta}{a^Ta}a.
$$
We will find that the $x$ that maximizes the objective function is $x = y/\|y\|$.

To see that this holds, let $u_1$ and $u_2$ denote the unit-vectors in the direction of $a$ and $y$ respectively. Notably, $u_2 = y/\|y\|$. Because $u_1,u_2$ are orthogonal with length $1$, we note that
$$
\|x\|^2 = (u_1^Tx)^2 + (u_2^Tx)^2 + \|x - (u_1^Tx)u_1 - (u_2^Tx )u_2\|^2.
$$
Now, the constraint that $x^Ta = 0$ means that $u_1^Tx = 0$. Thus, the above becomes
$$
\|x\|^2 = (u_2^Tx)^2 +  \|x - (u_2^Tx)u_2\|^2,
$$
which means that we must have $|u_2^Tx| \leq 1$. On the other hand, for any $x$ that is orthogonal to $a$, we have
$$
b^Tx = \|y\| \cdot u_2^Tx = \sqrt{\|b\|^2 - \frac{(b^Ta)^2}{\|a\|^2}} \cdot (u_2^Tx).
$$
Now, we can see that since we are given that $|u_2^Tx| \leq 1$, this expression is maximized when $u_2^Tx = 1$. The only unit-vector $x$ for which $u_2^Tx = 1$ is $x = u_2$, which is what we wanted.
