# Solving a completely variable equation

Suppose $f$ is an undetermined function which we want to obtain its form. We just know that it is coefficients of the below expansion as follows

enter code here$$(x+p)^i(x+q)^j=\sum_{u=0}^{i+j}f_u(i,j,p,q)x^u$$

How can I obtain an explicit form for $f$ using Mathematica? I need the form of $f$ for later calulations.

You can get a general solution for the desired fu(i,j,p,q) with SeriesCoefficient .

g[x_, i_, j_, p_, q_] = (x + p)^i*(x + q)^j;

f[u_, i_, j_, p_, q_] = SeriesCoefficient[g[x, i, j, p, q], {x, 0, u},
Assumptions -> u >= 0]

(*  p^i q^(j - u) Binomial[j, u] Hypergeometric2F1[-i, -u, 1 + j - u, q/p]  *)


For some u, you have to take Limit. (I didn't examine why.)

Proof the result

Table[g[x, i, j, p, q] ==
Sum[x^v*Limit[f[u, i, j, p, q], u -> v], {v, 0, i + j}],
{i, 0, 3}, {j, 0, 7}] // Simplify

(*   {{True, True, True, True, True, True, True, True},
{True, True, True, True, True, True, True, True},
{True, True, True, True, True, True, True, True},
{True, True, True, True, True, True, True, True}}   *)


May be this helps finding f.

• Many thanks but I confused by your code. Can you explain a bit? Jun 20, 2018 at 3:51
• This is not the desired closed form of function f,. I doubt, wheter there will be one. But this gives a general expression for the coefficients fu in your sum. I don't know, wether this helps for further analysis. Jun 20, 2018 at 8:39
• If this code provides me a general expression for $f_u$, it will be my desired answer. Please explain your code to clarify everything, Jun 20, 2018 at 14:39
• As for example g[x, 3, 7, p, q] // Collect[#, x] &  shows, g[...] is a series expansion in x^u, with u from 0 to 3+7. With SeriesCoefficient you get a general expression for the coefficients of every x^u. The last line 'Proof the result' shows, the f[u, i, j, p, q]  are ecactly the coefficients occuring in g[x, i, j, p, q]  . Jun 20, 2018 at 16:34