If you are using the function syntax y=x^2
, you had better use replacement rules to calculate at given values of x
:
Clear[x, y];
y = x^2;
y /. x -> 3
y /. x -> 5
Integrate[y, x]
Plot[y, {x, -2, 2}]
so that you don't need to clear values. However, I would rather do it this other function syntax:
f[x_] := x^2;
f[3]
f[5]
Integrate[f[x], x]
Plot[f[x], {x, -2, 2}]