I've been trying to use Manipulate to do interactive plotting, but I've been running into a few problems with saved expressions. I have an expression saved as "func" and I want to work with it and then plot it later. But I can't seem to get it to work. For example, this works fine
Manipulate[Plot[Sin[a x + b], {x, 0, 6}], {a, 1, 4}, {b, 0, 10}]
while this does not
func = Sin[a x + b];
Manipulate[Plot[func, {x, 0, 6}], {a, 1, 4}, {b, 0, 10}]
I assume that this has something to do with when expressions are evaluated and the difference between expressions and functions, but I'm new to Mathematica and and I'm not sure on on the difference between the two.
I have tried other things like the following. For example, this works
Manipulate[Plot[Function[{a, b, x}, Sin[a x + b]][a, b, x], {x, 0, 6}], {a, 1, 4}, {b, 0, 10}]
and this works
func2 = Function[{a, b, x}, Sin[a x + b]]
Manipulate[Plot[func2[a, b, x], {x, 0, 6}], {a, 1, 4}, {b, 0, 10}]
but this does not
func = Sin[a x + b];
func2 = Function[{a, b, x}, func];
Manipulate[Plot[func2[a, b, x], {x, 0, 6}], {a, 1, 4}, {b, 0, 10}]
How could I fix this and why doesn't it work the way I have it written?