I would like to solve that problem:
Let say I define $F[x]$ function:
F[x_] := Integrate[x^2, x]
Then I want to calculate eg. $F[2]$, but Mathematica emits an Integrate::ilim error ("Invalid integration variable or limit(s) in 2.") and throws me something strange:
$\int 4 d2$. Why it puts "$d2$" instead of "$dx$"? How to solve it, so I can easily use my $F[x]$ function?
We all know that $\int x^2 dx = \frac{x^3}{3}$, so the function $F(x)$ should be equal $F(x)=\frac{x^3}{3}$ and then $F(2) = \frac{2^3}{3}=\frac{8}{3}$ but it's not :/
Integrate[2^2,2]? – Daniel Lichtblau Jan 04 '17 at 00:24f[y_] := Integrate[x^2, x] /. x :> ythenf[2]yields8/3. – corey979 Jan 04 '17 at 00:29Setinstead ofSetDelayedin this instance. More information can be found in Understand the difference between Set (or =) and SetDelayed (or :=). – Edmund Jan 04 '17 at 00:30Setas the integral is performed once at assignment;f[x_] = Integrate[x^2, x]. – Edmund Jan 04 '17 at 00:33f[y_]:=f[y]=....– corey979 Jan 04 '17 at 00:34Set. – Edmund Jan 04 '17 at 00:35/.and:>are. – corey979 Jan 04 '17 at 00:37Integrateis using2as a *variable* of integration inF[2]? – Michael E2 Jan 04 '17 at 00:40