Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[385280]: htdocs / docs / original / maxima_1.html Maximize Restore History

Download this file

maxima_1.html    246 lines (189 with data), 8.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
from maxima.texi on 11 April 2003 -->
<TITLE>Maxima Manual - Introduction to MAXIMA</TITLE>
<link href="maxima_2.html" rel=Next>
<link href="maxima_toc.html" rel=ToC>
</HEAD>
<BODY>
<p>Go to the first, previous, <A HREF="maxima_2.html">next</A>, <A HREF="maxima_42.html">last</A> section, <A HREF="maxima_toc.html">table of contents</A>.
<P><HR><P>
<H1><A NAME="SEC1" HREF="maxima_toc.html#TOC1">Introduction to MAXIMA</A></H1>
<P>
Start MAXIMA with the command "maxima". MAXIMA will display version
information and a prompt. End each MAXIMA command with a semicolon.
End the session with the command "quit();". Here's a sample session:
</P>
<PRE>
sonia$ maxima
GCL (GNU Common Lisp) Version(2.3) Tue Mar 21 14:15:15 CST 2000
Licensed under GNU Library General Public License
Contains Enhancements by W. Schelter
Maxima 5.4 Tue Mar 21 14:14:45 CST 2000 (enhancements by W. Schelter)
Licensed under the GNU Public License (see file COPYING)
(C1) factor(10!);
8 4 2
(D1) 2 3 5 7
(C2) expand((x+y)^6);
6 5 2 4 3 3 4 2 5 6
(D2) y + 6 x y + 15 x y + 20 x y + 15 x y + 6 x y + x
(C3) factor(x^6-1);
2 2
(D3) (x - 1) (x + 1) (x - x + 1) (x + x + 1)
(C4) quit();
sonia$
</PRE>
<P>
MAXIMA can search the info pages. Use the <KBD>describe</KBD> command to show
all the commands and variables containing a string, and optionally their
documentation:
</P>
<PRE>
(C1) describe(factor);
0: DONTFACTOR :(maxima.info)Definitions for Matrices and ..
1: EXPANDWRT_FACTORED :Definitions for Simplification.
2: FACTOR :Definitions for Polynomials.
3: FACTORFLAG :Definitions for Polynomials.
4: FACTORIAL :Definitions for Number Theory.
5: FACTOROUT :Definitions for Polynomials.
6: FACTORSUM :Definitions for Polynomials.
7: GCFACTOR :Definitions for Polynomials.
8: GFACTOR :Definitions for Polynomials.
9: GFACTORSUM :Definitions for Polynomials.
10: MINFACTORIAL :Definitions for Number Theory.
11: NUMFACTOR :Definitions for Special Functions.
12: SAVEFACTORS :Definitions for Polynomials.
13: SCALEFACTORS :Definitions for Miscellaneous Options.
14: SOLVEFACTORS :Definitions for Equations.
Enter n, all, none, or multiple choices eg 1 3 : 2 8;
Info from file /d/linux/local/lib/maxima-5.4/info/maxima.info:
- Function: FACTOR (EXP)
factors the expression exp, containing any number of variables or
functions, into factors irreducible over the integers.
FACTOR(exp, p) factors exp over the field of integers with an
element adjoined whose minimum polynomial is p. FACTORFLAG[FALSE]
if FALSE suppresses the factoring of integer factors of rational
expressions. DONTFACTOR may be set to a list of variables with
respect to which factoring is not to occur. (It is initially
empty). Factoring also will not take place with respect to any
variables which are less important (using the variable ordering
assumed for CRE form) than those on the DONTFACTOR list.
SAVEFACTORS[FALSE] if TRUE causes the factors of an expression
which is a product of factors to be saved by certain functions in
order to speed up later factorizations of expressions containing
some of the same factors. BERLEFACT[TRUE] if FALSE then the
Kronecker factoring algorithm will be used otherwise the Berlekamp
algorithm, which is the default, will be used. INTFACLIM[1000] is
the largest divisor which will be tried when factoring a bignum
integer. If set to FALSE (this is the case when the user calls
FACTOR explicitly), or if the integer is a fixnum (i.e. fits in
one machine word), complete factorization of the integer will be
attempted. The user's setting of INTFACLIM is used for internal
calls to FACTOR. Thus, INTFACLIM may be reset to prevent MACSYMA
from taking an inordinately long time factoring large integers.
NEWFAC[FALSE] may be set to true to use the new factoring routines.
Do EXAMPLE(FACTOR); for examples.
- Function: GFACTOR (EXP)
factors the polynomial exp over the Gaussian integers (i. e.
with SQRT(-1) = %I adjoined). This is like FACTOR(exp,A**2+1)
where A is %I.
(C1) GFACTOR(X**4-1);
(D1) (X - 1) (X + 1) (X + %I) (X - %I)
(D1) FALSE
</PRE>
<P>
To use a result in later calculations, you can assign it to a variable or
refer to it by its automatically supplied label. In addition, <KBD>%</KBD>
refers to the most recent calculated result:
</P>
<PRE>
(C2) u:expand((x+y)^6);
6 5 2 4 3 3 4 2 5 6
(D2) y + 6 x y + 15 x y + 20 x y + 15 x y + 6 x y + x
(C3) diff(u,x);
5 4 2 3 3 2 4 5
(D3) 6 y + 30 x y + 60 x y + 60 x y + 30 x y + 6 x
(C4) factor(d3);
5
(D4) 6 (y + x)
</PRE>
<P>
MAXIMA knows about complex numbers and numerical constants:
</P>
<PRE>
(C6) cos(%pi);
(D6) - 1
(C7) %e^(%i*%pi);
(D7) - 1
</PRE>
<P>
MAXIMA can do differential and integral calculus:
</P>
<PRE>
(C8) u:expand((x+y)^6);
6 5 2 4 3 3 4 2 5 6
(D8) y + 6 x y + 15 x y + 20 x y + 15 x y + 6 x y + x
(C9) diff(%,x);
5 4 2 3 3 2 4 5
(D9) 6 y + 30 x y + 60 x y + 60 x y + 30 x y + 6 x
(C10) integrate(1/(1+x^3),x);
2 x - 1
2 ATAN(-------)
LOG(x - x + 1) SQRT(3) LOG(x + 1)
(D10) - --------------- + ------------- + ----------
6 SQRT(3) 3
</PRE>
<P>
MAXIMA can solve linear systems and cubic equations:
</P>
<PRE>
(C11) linsolve( [ 3*x + 4*y = 7, 2*x + a*y = 13], [x,y]);
7 a - 52 25
(D11) [x = --------, y = -------]
3 a - 8 3 a - 8
(C12) solve( x^3 - 3*x^2 + 5*x = 15, x);
(D12) [x = - SQRT(5) %I, x = SQRT(5) %I, x = 3]
</PRE>
<P>
MAXIMA can solve nonlinear sets of equations. Note that if you don't
want a result printed, you can finish your command with <KBD>$</KBD> instead
of <KBD>;</KBD>.
</P>
<PRE>
(C13) eq1: x^2 + 3*x*y + y^2 = 0$
(C14) eq2: 3*x + y = 1$
(C15) solve([eq1, eq2]);
3 SQRT(5) + 7 SQRT(5) + 3
(D15) [[y = - -------------, x = -----------],
2 2
3 SQRT(5) - 7 SQRT(5) - 3
[y = -------------, x = - -----------]]
2 2
</PRE>
<P>
Under the X window system, MAXIMA can generate plots of one or more
functions:
</P>
<PRE>
(C13) plot2d(sin(x)/x,[x,-20,20]);
(YMIN -3.0 YMAX 3.0 0.29999999999999999)
(D13) 0
(C14) plot2d([atan(x), erf(x), tanh(x)], [x,-5,5]);
(YMIN -3.0 YMAX 3.0 0.29999999999999999)
(YMIN -3.0 YMAX 3.0 0.29999999999999999)
(YMIN -3.0 YMAX 3.0 0.29999999999999999)
(D14) 0
(C15) plot3d(sin(sqrt(x^2+y^2))/sqrt(x^2+y^2),[x,-12,12],[y,-12,12]);
(D15) 0
</PRE>
<P>
Moving the cursor to the top left corner of the plot window will pop up
a menu that will, among other things, let you generate a PostScript file
of the plot. (By default, the file is placed in your home directory.)
You can rotate a 3D plot.
</P>
<P><HR><P>
<p>Go to the first, previous, <A HREF="maxima_2.html">next</A>, <A HREF="maxima_42.html">last</A> section, <A HREF="maxima_toc.html">table of contents</A>.
</BODY>
</HTML>