Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Maxima Class Notes

1 MaximaMaxima is a computer algebric system


software. It is used for themanipulation of dif-
ferent mathematical functions. It faciliates graph-
swhich is helpful for alearner.

2 Advantages Of Maxima

2.1 save time

2.2 simple UI

2.3 Less restrictions

3 Various Arithemetic Operations

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)

3.6 Remainder of x/y

(% i7) mod(9,4);
1 (% o7)

4 Commands for different arithmetic Functions


4.1 sqrt():Returns the square root of the given caluee

(% i8) sqrt(81);
9 (% o8)

4.2 float() : converts the value to float type

(% i9) float(sqrt(3));
1.732050807568877 (% o9)

4.3 abs() : Returns the absolute value

(% i10) abs(-350);
350 (% o10)

2
4.4 ceiling() : Least integer function

(% i11) ceiling(9.2);

10 (% o11)

4.5 floor() : Greatest integer function

(% i12) floor(5.1);

5 (% o12)

4.6 round() : Rounds off to the nearest whole number


For even numbers, 0.5will be rounded downFor odd
numbers, 0.5 will be rounded up

(% i13) round(9.78);

10 (% o13)

4.7 min() : returns the smallest value from the list

(% i14) min(-0.5,5,11);

−0.5 (% o14)

4.8 max() : returns the largest value from the set

(% i15) max(104,127,213);

213 (% o15)

3
5 Constants

5.1 %i : Imaginary number

5.2 %e : Exponential

5.3 %pi : Pi π

5.4 inf : ∞

5.5 minf : -∞

6 Variable and Functions

6.1 values can be assigned to variables byusing ":" and


end it with "$".

(% i18) x:10$y:30$x+y;

40 (% o18)

6.2 Functions should be declared by using ’:=’

(% i20) f(x) := sin(x)$f(2*(%pi));

0 (% o20)

6.3 Multiple values can also be assigned using [a,b,c,d]:[5,8,4,9]

(% 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

8.1 sum(function, variable, from, to): Gives the summa-


tion

(% i26) sum(kˆ2,k,1,10);
385 (% o26)

8.2 lcm(eq1,eq2): Gives the LCM of the set

(% i27) lcm(32,16,48,64);
192 (% o27)

8.3 gcd(eq1, eq2): Gives the GCD of polynomials

(% i28) gcd(x^2, (x+1));


1 (% o28)

8.4 divide(eq1, eq2): Divides the two polynomials

(% i29) divide(x^3+x^2,x);
x ˆ3 + x ˆ2
[ , 0] (% o29)
10

5
8.5 limit(func, var, val): Gives the limit

8.6 diff(func,var,times): Differentiates the given function,


with respect to thegiven variable, to the given number
of times

8.7 integrate(func, var, from, to): Integrates the function


with respect to thegiven variable in the given interval

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)

1.2 Square the previous output.

(% i35) %ˆ2;

4.316961204562175 (% o35)

2 Evaluate cos 53 and tan12π/22.

(% 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);

4 . Generate a list of values for the function


f(x)=sin(x) in the range 0 toπ.Express thean-
swer in float.

(% i42) makelist(float(sin(x)),x,0,%pi);

[0.0 , 0.8414709848078965 , 0.9092974268256817 , 0.1411200080598672] (% o42)

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;

Enter the second equation (b)

x−y = 0; solve: variable must not be a number; found: 10 – an error. To debug this try: debugmode(true);

2 Write a program to find roots of a polynomial


where polynomial is providedby the user.

(% i46) a:read("Enter the polynomial (a): ")$print("roots of the polyno-


mial=",allroots(a))$
Enter the polynomial (a):

3 Write a program to enter two numbers a and b


and find their sum,difference, product and the
remainder when a is divided by b.

−→ a:read("Enter first number (a) ")$b:read("Enter second number (b)


")$print("a+b=",a+b)$print("a-b=",ab)$print("a*b=",a*b)$print("remainder
when a/b=",mod(a,b))$

9
4 Write a program to find the area of a circle
whose radius is provided bythe user.

−→ r:read("Enter the radius of the circle (r): ")$print("area of the circle


=",3.14*r*r)$

5 Write a program to find the lcm and gcd of two


given numbers using thebuilt in functions.

−→ a:read("Enter first number (a): ")$b:read("Enter second number


(b):")$print("LCM=",lcm(a,b))$print("GCD=",gcd(a,b))$

10

You might also like