Hi all,
I am new in this forum and hope that some of you can help. I have two questions which are related to eachother. It's all about defining parameters accurately and I think that I just don't know how to do this correctly.
General Problem
Assuming the function
f[x_]:=a*x^2
where a is a real number. How can I tell Mathematica that, for example, a is an integer? I found a solution using "Assumptions" as in
Assuming -> Element[a, Integers]
but this doesn't work always (for example when I want to solve a system of equations, I got an error). I am looking for an easy solution where I can introduce my variables at the beginning and then use them all the time (the same as how we do it on paper).
One important example that doesn't work
The next problem (and I think that this is the same as the previous one) is as follows: I have the same function as above
f[x_]:=a*x^2
Now, I want to use the manipulation function as in
Manipulate[Plot[f[x],{x,-5,5}],{a,1,50}]
When I enter the function itself in the Manipulate argument (instead of "f[x]"), it works. But the way I described it, it doesn't. Probably, I have to introduce the parameter a, but I just don't know how.
Is something like this possible?
To illustrate my problem, another example:
When I enter
a=10
and
b=20
the command
Plot[x^2,{x,a,b}]
works perfectly. Now, I want to enter something like
a,b=real
Thanks in advance for the answers.