Suppose I have a polynomial
$a_0+a_1 f(x,t) + a_2 f(x,t)^2 + ....$.
In code,
a0 + a1 y + a2 y^2 + a3 y^3 /. y :> Integrate[Subscript[y, k] E^(I k y), k]
a0 + a1 Integrate[E^(I k y) Subscript[y, k], k] + a2 Integrate[E^(I k y) Subscript[y, k], k]^2 + a3 Integrate[E^(I k y) Subscript[y, k], k]^3
I want to replace $f$ with $\int f_k(t) e^{ik x}dk$. The problem that I am facing is that when I use the replace rule, I get
$\qquad a_0+a_1 \int f_k(t) e^{ikx}dk + a_2 (\int f_k(t) e^{ikx}dk)^2 + ....$
on and on. Is there a way to sort integration variable such that I get
$\qquad a_0+a_1 \int f_{k_1}(t) e^{ik_1x}dk_1 + a_2 (\int f_{k_1}(t) e^{i{k_1}x}dk_1)(\int f_{k_2}(t) e^{i{k_2}x}dk_2) + ...$
automatically? Assume I can't fiddle with the code to generate these polynomials. Similarly let's say I have collected 3rd order terms which would look like
$\qquad \sum_i\hat L_i[f(x,t)]\hat K_i[f(x,t)]\hat T_i[f(x,t)],$
where $\hat L, \hat K , \hat T$ are some operators. Is there also ways to plug in the Fourier transformation of f so that the integration variables are automatically sorted?
Subscript
while defining symbols (variables).Subscript[x, 1]
is not a symbol, but a composite expression whereSubscript
is an operator without built-in meaning. You expect to do $x_1=2$ but you are actually doingSet[Subscript[x, 1], 2]
which is to assign aDownValues
to the operatorSubscript
and not anOwnValues
to an indexedx
as you may intend. Read how to properly define indexed variables here $\endgroup$