~ubuntu-branches/ubuntu/karmic/maxima/karmic

« back to all changes in this revision

Viewing changes to doc/info/Introduction.texi

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-11-13 18:39:14 UTC
  • mto: (2.1.2 hoary) (3.2.1 sid) (1.1.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20041113183914-ttig0evwuatnqosl
Tags: upstream-5.9.1
ImportĀ upstreamĀ versionĀ 5.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
Contains Enhancements by W. Schelter
13
13
Maxima 5.4 Tue Mar 21 14:14:45 CST 2000 (enhancements by W. Schelter)
14
14
Licensed under the GNU Public License (see file COPYING)
15
 
(C1) factor(10!);
 
15
(%i1) factor(10!);
16
16
 
17
17
                                   8  4  2
18
 
(D1)                              2  3  5  7
19
 
(C2) expand((x+y)^6);
 
18
(%o1)                              2  3  5  7
 
19
(%i2) expand((x+y)^6);
20
20
 
21
21
           6        5       2  4       3  3       4  2      5      6
22
 
(D2)      y  + 6 x y  + 15 x  y  + 20 x  y  + 15 x  y  + 6 x  y + x
23
 
(C3) factor(x^6-1);
 
22
(%o2)      y  + 6 x y  + 15 x  y  + 20 x  y  + 15 x  y  + 6 x  y + x
 
23
(%i3) factor(x^6-1);
24
24
 
25
25
                                     2            2
26
 
(D3)               (x - 1) (x + 1) (x  - x + 1) (x  + x + 1)
27
 
(C4) quit();
 
26
(%o3)               (x - 1) (x + 1) (x  - x + 1) (x  + x + 1)
 
27
(%i4) quit();
28
28
 
29
29
sonia$
30
30
@end example
34
34
documentation:
35
35
 
36
36
@example
37
 
(C1) describe(factor);
 
37
(%i1) describe(factor);
38
38
 
39
39
 
40
40
 0: DONTFACTOR :(maxima.info)Definitions for Matrices and ..
87
87
     factors the polynomial exp over the Gaussian integers (i.  e.
88
88
     with SQRT(-1) = %I adjoined).  This is like FACTOR(exp,A**2+1)
89
89
     where A is %I.
90
 
          (C1)  GFACTOR(X**4-1);
91
 
          (D1)        (X - 1) (X + 1) (X + %I) (X - %I)
92
 
(D1)                                 FALSE
 
90
          (%i1)  GFACTOR(X**4-1);
 
91
          (%o1)        (X - 1) (X + 1) (X + %I) (X - %I)
 
92
(%o1)                                FALSE
93
93
@end example
94
94
 
95
95
To use a result in later calculations, you can assign it to a variable or
97
97
refers to the most recent calculated result:
98
98
 
99
99
@example
100
 
(C2) u:expand((x+y)^6);
 
100
(%i2) u:expand((x+y)^6);
101
101
 
102
102
           6        5       2  4       3  3       4  2      5      6
103
 
(D2)     y  + 6 x y  + 15 x  y  + 20 x  y  + 15 x  y  + 6 x  y + x
104
 
(C3) diff(u,x);
 
103
(%o2)     y  + 6 x y  + 15 x  y  + 20 x  y  + 15 x  y  + 6 x  y + x
 
104
(%i3) diff(u,x);
105
105
 
106
106
                5         4       2  3       3  2       4        5
107
 
(D3)        6 y  + 30 x y  + 60 x  y  + 60 x  y  + 30 x  y + 6 x
108
 
(C4) factor(d3);
 
107
(%o3)        6 y  + 30 x y  + 60 x  y  + 60 x  y  + 30 x  y + 6 x
 
108
(%i4) factor(%o3);
109
109
 
110
110
                                           5
111
 
(D4)                             6 (y + x)
 
111
(%o4)                             6 (y + x)
112
112
@end example
113
113
 
114
114
MAXIMA knows about complex numbers and numerical constants:
115
115
 
116
116
@example
117
 
(C6) cos(%pi);
118
 
 
119
 
(D6)                                  - 1
120
 
 
121
 
(C7) %e^(%i*%pi);
122
 
 
123
 
(D7)                                  - 1
 
117
(%i6) cos(%pi);
 
118
 
 
119
(%o6)                                  - 1
 
120
 
 
121
(%i7) %e^(%i*%pi);
 
122
 
 
123
(%o7)                                  - 1
124
124
@end example
125
125
 
126
126
MAXIMA can do differential and integral calculus:
127
127
 
128
128
@example
129
 
(C8) u:expand((x+y)^6);
 
129
(%i8) u:expand((x+y)^6);
130
130
 
131
131
           6        5       2  4       3  3       4  2      5      6
132
 
(D8)     y  + 6 x y  + 15 x  y  + 20 x  y  + 15 x  y  + 6 x  y + x
133
 
(C9) diff(%,x);
 
132
(%o8)     y  + 6 x y  + 15 x  y  + 20 x  y  + 15 x  y  + 6 x  y + x
 
133
(%i9) diff(%,x);
134
134
 
135
135
                5         4       2  3       3  2       4        5
136
 
(D9)        6 y  + 30 x y  + 60 x  y  + 60 x  y  + 30 x  y + 6 x
137
 
(C10) integrate(1/(1+x^3),x);
 
136
(%o9)        6 y  + 30 x y  + 60 x  y  + 60 x  y  + 30 x  y + 6 x
 
137
(%i10) integrate(1/(1+x^3),x);
138
138
 
139
139
                                         2 x - 1
140
140
                       2            ATAN(-------)
141
141
                  LOG(x  - x + 1)        SQRT(3)    LOG(x + 1)
142
 
(D10)           - --------------- + ------------- + ----------
 
142
(%o10)           - --------------- + ------------- + ----------
143
143
                         6             SQRT(3)          3
144
144
@end example
145
145
 
146
146
MAXIMA can solve linear systems and cubic equations:
147
147
 
148
148
@example
149
 
(C11) linsolve( [ 3*x + 4*y = 7, 2*x + a*y = 13], [x,y]);
 
149
(%i11) linsolve( [ 3*x + 4*y = 7, 2*x + a*y = 13], [x,y]);
150
150
 
151
151
                               7 a - 52        25
152
 
(D11)                     [x = --------, y = -------]
 
152
(%o11)                     [x = --------, y = -------]
153
153
                               3 a - 8       3 a - 8
154
 
(C12) solve( x^3 - 3*x^2 + 5*x = 15, x);
 
154
(%i12) solve( x^3 - 3*x^2 + 5*x = 15, x);
155
155
 
156
 
(D12)              [x = - SQRT(5) %I, x = SQRT(5) %I, x = 3]
 
156
(%o12)              [x = - SQRT(5) %I, x = SQRT(5) %I, x = 3]
157
157
@end example
158
158
 
159
159
MAXIMA can solve nonlinear sets of equations.  Note that if you don't
161
161
of @kbd{;}.
162
162
 
163
163
@example
164
 
(C13) eq1: x^2 + 3*x*y + y^2 = 0$
165
 
 
166
 
(C14) eq2: 3*x + y = 1$
167
 
 
168
 
(C15) solve([eq1, eq2]);
 
164
(%i13) eq1: x^2 + 3*x*y + y^2 = 0$
 
165
 
 
166
(%i14) eq2: 3*x + y = 1$
 
167
 
 
168
(%i15) solve([eq1, eq2]);
169
169
 
170
170
              3 SQRT(5) + 7      SQRT(5) + 3
171
 
(D15) [[y = - -------------, x = -----------],
 
171
(%o15) [[y = - -------------, x = -----------],
172
172
                    2                 2
173
173
 
174
174
                                    3 SQRT(5) - 7        SQRT(5) - 3
180
180
functions:
181
181
 
182
182
@example
183
 
(C13) plot2d(sin(x)/x,[x,-20,20]);
184
 
 
185
 
 
186
 
(YMIN -3.0 YMAX 3.0 0.29999999999999999) 
187
 
(D13)                                  0
188
 
(C14) plot2d([atan(x), erf(x), tanh(x)], [x,-5,5]);
189
 
 
190
 
 
191
 
(YMIN -3.0 YMAX 3.0 0.29999999999999999) 
192
 
(YMIN -3.0 YMAX 3.0 0.29999999999999999) 
193
 
(YMIN -3.0 YMAX 3.0 0.29999999999999999) 
194
 
(D14)                                  0
195
 
(C15) plot3d(sin(sqrt(x^2+y^2))/sqrt(x^2+y^2),[x,-12,12],[y,-12,12]);
196
 
 
197
 
(D15)                                  0
 
183
(%i13) plot2d(sin(x)/x,[x,-20,20]);
 
184
 
 
185
 
 
186
(YMIN -3.0 YMAX 3.0 0.29999999999999999) 
 
187
(%o13)                                  0
 
188
(%i14) plot2d([atan(x), erf(x), tanh(x)], [x,-5,5]);
 
189
 
 
190
 
 
191
(YMIN -3.0 YMAX 3.0 0.29999999999999999) 
 
192
(YMIN -3.0 YMAX 3.0 0.29999999999999999) 
 
193
(YMIN -3.0 YMAX 3.0 0.29999999999999999) 
 
194
(%o14)                                  0
 
195
(%i15) plot3d(sin(sqrt(x^2+y^2))/sqrt(x^2+y^2),[x,-12,12],[y,-12,12]);
 
196
 
 
197
(%o15)                                  0
198
198
@end example
199
199
 
200
200
Moving the cursor to the top left corner of the plot window will pop up