The title says it all. Reading posts such as this however, I'm not seeing how to do this. This is the simplest example that can show my problem.
f = c/x;
a = a1;
b = b1;
NIntegrate[f, {x, a, b}] /. {a1 -> 1, b1 -> 4, c -> 2}
The title says it all. Reading posts such as this however, I'm not seeing how to do this. This is the simplest example that can show my problem.
f = c/x;
a = a1;
b = b1;
NIntegrate[f, {x, a, b}] /. {a1 -> 1, b1 -> 4, c -> 2}
You just have to make the substitution in both the function and limits before NIntegrate. Simple example:
f = c/x;
NIntegrate[f /. #, {x, a, b} /. #] & @ {a -> 1, b -> 4, c -> 2}
Holding NIntegrate Unevaluted also works.
Unevaluated[NIntegrate[f, {x, a, b}]] /. {a -> 1, b -> 4, f -> 2/x}
(* 2.77259 *)
Maybe little odd method:
g[f, {x, a, b}] /. {a1 -> 1, b1 -> 4, c -> 2, g -> NIntegrate}