The problem is that I have to evaluate functions, that take output from previous functions, and combine them to form new functions, and do some operations and evaluate the value at new function.
But, Here is a simple example to demonstrate my problem:
g[x_] := 3 x^2 + 2 x f[x_] := 20 x + Integrate[g[x], x] f
During evaluation of In:= Integrate::ilim: Invalid integration variable or limit(s) in 2. >>
So, as you can see, you get the error, because it tries to evaluate integral with respect to 2 instead of with respect to x.
That means we need to force
Integrate function to evaluate w.r.t x, then, it can substitute x = 2. But, how is that possible here?