Did you try reading the
documentation (this is for version 4.4)? Section 6 of that document tells you how to read commands from a file.
Plotting standard functions can be done as you might think:
gnuplot> plot sin(x)
For powers, it seems you have to use '**' (like in FORTRAN):
gnuplot> plot x**2
The documentation should cover these things, too.