I have the following problem: The functions $a_i(x) > 0$ and $b_i(x) > 0$ for $x\in I \subset \mathbb{R}$, $I$ compact, and $i=1,\ldots,n$ are given. The objective is to find functions $f_i(x)$ such that \begin{align} f_i(x) &\geq 0 \qquad \text{ for all $x$}\\ \sum_{i=1}^n f_i(x) &\leq 1 \qquad \text{ for all $x$}\\ \int_I f_i(x) \cdot a_i(x) \, dx &= 1 \qquad \text{ for all $i$}\\ \sum_{i=1}^n \int_I f_i(x) \cdot b_i(x) \, dx &\to \min \\ \end{align}
(None of the functions $a_i,b_i,f_i$ need to be continuous.) I know that a solution exists because I have a set of functions $\tilde{f}_i(x)$ satisfying the three constraints. My background in optimisation is close to negligible (am I right that the problem is convex?), which is why what would help me a lot is if you could (1) tell me if this problem is part of a larger well-studied class, possibly even with emough theory to derive the solution analytically and/or (2) point me in the right direction in terms of how to tackle the problem numerically.
If $n=1$ (only one function to find), the problem seems trivial, the basic idea being to start setting $f(x)=1$ in points $x$ where $b(x)$ is lowest, to continue doing so until the third constraint is reached, and to set $f(x)=0$ elsewhere (i.e. in points where $b(x)$ is high).