We'll look at various equations. A quadratic, a cubic and a quartic(a
fourth order polynomial so will have x4 terms in it).
The first 2 you are more familiar with and can do by hand, the quartic
is that bit trickier. Of course using mathematica it's all the same. So
just type in:
Solve[x3+2x2+4x-7 = = 0, x]
or
NSolve[x3+2x2+4x-7 = = 0, x]
and your done.
Plotting functions:
This too is easy enough. Exactly what you would have guessed in fact.
It is Plot with a capital P. The arguements are then given in square brackets
and the range of x's which you plot are given in curly ones as in the Integrate
command. So to plot x2 from -10 to 10 we type:
Plot[f,{x,-10,10}]
You can specify the y-range too by specifiying the PlotRange. From the
notes we have:
We use this because the function goes to infinity between -5 and +5 so by
limiting y to between +5 and -5 we get a more sensible graph.
Defining your own functions:
We can define our own constants. So we can say that interest=0.1.
To define a function f(x) = x2+1 say we type
f[x_] = x2+1
then we can type f(5) and mathematica will work that out to be
52+1 = 26
.
Once we have this we can perform calulations using f(x). Then
the calculations can be repeated easily for different cases
by changing f(x)'s definition.
Tutorial questions(need to do the last two on mathematica before the
tutorial!):
Express 5,7,13,21 in binary, octal and hex.
What is (341)5 and (211)16 in base 10.
Express [41/3] in binary.
Determine
ó õ
xcos(x) dx
and
ó õ
2
0
3x4x3+2
dx.
Solve x4-x3+4x2+3 = 0.
File translated from
TEX
by
TTH,
version 2.70. On 1 Nov 2002, 11:08.