I define a function y=f(x), I evaluate the function @ some x and the later time I want to integrate the same function. I used clear[x] and clear[y]
But still get wrong answer. How to clear? And is there anyways in Mathematica to clear the screen as such you can start everything from the beginning?
To start from the beginning reset the Kernel. This will clear all definitions.
You can also do that by executing Quit[]
**Thank you Sander. I did tried both. But the screen till exactly the same. Nothing changed. ** Right now the only way to clear the screen is to select every single subsection in the notebook and delete them manually.
Here is the notebook and I finish by Quit[] and press shift enter but nothing happened to the screen. Also in that file I was trying to use the Grid function but it fails every time I try.
Thanks for your help.
It only restarts the Kernel, so all definitions are lost. But the frontend is still active. If you want to clear that, just create a new notebook or select all and press delete.
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}]