I'm working on a problem that involves vectors and scalar values, and I'm looking for a closed-form solution. I hope someone can help me with this or provide insights into how to approach it. Here's the problem:


Given vectors $\mathbf{W}$, $\mathbf{S}$, and $\mathbf{T}$, and a scalars $q$.


The goal is to find a scalar $x$ so that the following constraint is satisfied:
$$
\sum \left(\frac{\mathbf{W} \cdot (q + x)}{\sum \mathbf{W} \cdot \mathbf{S}} \cdot \mathbf{T}\right) = q
$$
I have tried using optimization techniques, which work for specific instances but do not provide a general closed-form solution. I'm wondering if there's a closed-form solution to this problem, or if there are any alternative methods or insights to find the scalar $x$ for arbitrary vectors and scalar $q$.


For clarity, by $A\cdot B$ I mean the element-wise product
$$A\cdot B=[a\_1b\_1,a\_2b\_2,a\_3b\_3]$$


If helpful, here's the same definition and constraints in pseudocode:



```
find x such that sum((W * (q + x) / sum(W * S)) * T) == q

```

I've searched:


1. "vector equation closed-form"
2. "scalar equation with vectors"
3. "sum of products of vectors"
4. "linear algebra vector optimization"


But I'm not seeing anything that catches my eye.


Any help or guidance would be greatly appreciated!



Seeking closed-form solution for vector equation
The sum of the entrywise product of two vectors is just their dot product. So this question is asking how to find $x$ so that
$$
(q+x)(\mathbf{W} \cdot \mathbf{T}) = q\mathbf{W} \cdot\mathbf{S}.
$$
This is just a scalar equation; rearranging and solving gives
$$
x = \frac{q\mathbf{W} \cdot(\mathbf{S} - \mathbf{T})}{\mathbf{W} \cdot \mathbf{T}}
$$
as the unique solution.


