Consider the problem of finding the values of $\alpha_1, \alpha_2, ..., \alpha_k$, subject to constraints, such that the following equation is satisfied
\begin{equation} \alpha_1 x_1 + \alpha_2 x_2 + \dots \alpha_k x_k = P \end{equation}
where all $x_i$'s and $P$ are real numbers.
For example, the constraint of uniform scaling of the $x_i$'s would be setting $\alpha_i = \frac{P}{\sum_i x_i}$.
Now I wish to scale the $x_i$'s such that the ratio between $\alpha$'s is equal to the ratio between the respective $x$'s, that is:
\begin{equation} \frac{\alpha_m}{\alpha_n} = \frac{x_m}{x_n} \end{equation} for all $m, n$.
A solution is to set:
\begin{equation} \alpha_i = \frac{x_i P}{x_1^2 + x_2^2 + \dots + x_k^2} \end{equation}
What is this called? Is there anyway to find this solution quickly without knowing it before hand?
Can it be generalised?