Suppose I have an arbitrary function $f$ of $n$ variables.
For simplicity, let's assume that $n=3$. Suppose that I have its explicit form, $f(x,y,z)$ and I want to expand it into a sum of terms, each of which is separable in all variables, i.e.
How would I do that? No additional properties are required and the multiplicative constant can be either factored out, distributed over all 3 functions in each term, or included only in one of the functions, it's irrelevant. What's relevant is that $a_i$,$b_i$ and $c_i$ depend only on a single variable.
I tried using this, but it doesn't work with more complicated functions. In my cases, I need to separate a mess with a lot of $\Gamma$-functions. I don't really care about the form of these single-variable functions, they can be in closed form (if it exists) or they can be expressed through a series expansion, as long as it's exact.