Professional Documents
Culture Documents
Maxima Class Notes: 2.1 Save Time 2.2 Simple UI 2.3 Less Restrictions
Maxima Class Notes: 2.1 Save Time 2.2 Simple UI 2.3 Less Restrictions
2 Advantages Of Maxima
2.2 simple UI
3.1 Additon
(% i1) 35+55;
90 (% o1)
3.2 Subtraction
(% i2) 30-2;
28 (% o2)
3.3 Product
(% i3) 4*2;
8 (% o3)
1
3.4 Division
(% i4) 100/5;
20 (% o4)
3.5 Exponentiation
(% i5) 12ˆ3;
1728 (% o5)
(% i6) 12**3;
1728 (% o6)
(% i7) mod(9,4);
1 (% o7)
(% i8) sqrt(81);
9 (% o8)
(% i9) float(sqrt(3));
1.732050807568877 (% o9)
(% i10) abs(-350);
350 (% o10)
2
4.4 ceiling() : Least integer function
(% i11) ceiling(9.2);
10 (% o11)
(% i12) floor(5.1);
5 (% o12)
(% i13) round(9.78);
10 (% o13)
(% i14) min(-0.5,5,11);
−0.5 (% o14)
(% i15) max(104,127,213);
213 (% o15)
3
5 Constants
5.2 %e : Exponential
5.3 %pi : Pi π
5.4 inf : ∞
5.5 minf : -∞
(% i18) x:10$y:30$x+y;
40 (% o18)
0 (% o20)
(% i22) [a,b,c,d]:[5,8,4,9];b;
[5 , 8 , 4 , 9] (% o21)
8 (% o22)
4
7 Makelistcreates an array to store values for a
given function.Syntax: makelist(function,variable,start
value, end value). Any element ofthe list can
also be acesssed using the index:
(% i24) A: makelist(round(float(sin(xˆ2))),x,1,4)$;(A);
[1 , −1 , 0 , 0] (% o24)
(% i25) A[3];
0 (% o25)
8 Built in commands
(% i26) sum(kˆ2,k,1,10);
385 (% o26)
(% i27) lcm(32,16,48,64);
192 (% o27)
(% i29) divide(x^3+x^2,x);
x ˆ3 + x ˆ2
[ , 0] (% o29)
10
5
8.5 limit(func, var, val): Gives the limit
6
Assignment 1:
1 Perform the following arithmetic operations:1.1.
Let a = 818 , b = 79 .Compute a*b.
(% i32) a:8/18$b:7/9$a*b;
28
(% o32)
81
√
1.1 Add 3 to the previous output and express the result
as a decimal representation.
(% i33) %+sqrt(3);
√ 28
3+ (% o33)
81
(% i34) float(%);
2.077729819914556 (% o34)
(% i35) %ˆ2;
4.316961204562175 (% o35)
(% i36) float(cos(53));
−0.9182827862121189 (% o36)
(% i37) float(tan((12*%pi)/22));
−6.955152771773481 (% o37)
7
3 . Solve the system of linear equations: x+y=6;
y-3x = 2.
(% i39) linsolve([x+y=6,y-3*x=2],[x,y]);
solve: variable must not be a number; found: 10 – an error. To debug this try: debugmode(true);
(% i42) makelist(float(sin(x)),x,0,%pi);
8
Assignment 2:
1 Write a program to solve two system of equa-
tions (user defined).
(% i45) a:read("Enter the first equation (a): ")$b:read("Enter the second equation
(b)")$print( linsolve([a,b],[x,y]))$
Enter the first equation (a):
x + y = 2;
x−y = 0; solve: variable must not be a number; found: 10 – an error. To debug this try: debugmode(true);
9
4 Write a program to find the area of a circle
whose radius is provided bythe user.
10