Lab Manual - NEP - MATDSCP 6.1
Lab Manual - NEP - MATDSCP 6.1
Lab Manual - NEP - MATDSCP 6.1
● Learn Free and Open Source Software (FOSS) tools for computer programming
● Solve problem on Linear Algebra and Integral Calculus studied in MATDSCT 6.1 by
using FOSS software’s.
● Acquire knowledge of applications of Linear Algebra and Integral Calculus through
FOSS
Special Note:
List of Experiments:
I UNIT-1 2 1 4 4
II UNIT-2 2 1 4 4
III UNIT-3 2 1 4 4
IV UNIT-4 2 1 4 4
VIVA 4
RECORD 5
TOTAL 25
NOTE: Distribution of marks for manual work and execution will be done proportionately.
Solution: Let
(3,7, −4) = a(1,2,3) + b(2,3,7) + c(3,5,6) ………………..(A)
⇒ (3,7, −4) = (a + 2b + 3c, 2a + 3b + 5c, 3a + 7b + 6c)
⇒ 3 = a + 2b + 3c …………………..(1)
7 = 2a + 3b + 5c………………………(2)
−4 = 3a + 7b + 6c…………………….(3)
Now solving (1),(2) and (3) we obtain the values of a, b and c
(2)-2(1) gives,
1 = −𝑏 − 𝑐………………….(4)
(3) − 3(1) gives,
−13 = b − 3c ………………(5)
Now (4)+(5) gives,
−12 = −4c ⇒ 𝑐 = 3
Putting 𝑐 = 3 in (4) we get 𝑏 = −4.
Now, putting 𝑏 = −4 𝑎𝑛𝑑 𝑐 = 3 in (1) we get 𝑎 = 2
Therefore equation (A) becomes
(3,7, −4) = 2(1,2,3) + (−4)(2,3,7) + 3(3,5,6) which is the required linear combination.
Maxima Program:
kill(all)$
v:[3,7,-4]$
v1:[1,2,3]$
v2:[2,3,7]$
v3:[3,5,6]$
e:a*v1+b*v2+c*v3$
[globalsolve:true,programmode:true]$
h:linsolve([e[1]=v[1],e[2]=v[2],e[3]=v[3]],[a,b,c]);
V:a*v1+b*v2+c*v3$
if (V=v)then
print("The linear combination of vector",v,"=",a,v1,"+",b,v2,"+",c,v3)
else
print("v is not a linear combination of v1,v2,v3")$
Output:
4) Express (2,-5,3) as a linear combination of the vectors (1,-3,2), (2,-4,-1) and (1,-5,7).
Maxima program:
kill(all)$
v:[3,-1,1,-2]$
v1:[1,1,0,-1]$
v2:[1,1,-1,0]$
v3:[1,-1,0,0]$
e:a*v1+b*v2+c*v3;
[globalsolve:true,programmode:true]$
h:linsolve([e[1]=v[1],e[2]=v[2],e[3]=v[3]],[a,b,c]);
V:a*v1+b*v2+c*v3$
if (V=v)then
print("The linear combination of vector ",v,"=",a,v1,"+",b,v2,"+",c,v3)
else
print("v is not a linear combination of v1,v2,v3")$
Output:
Definition:
A finite set {⍺1 ,⍺2 , . . . , ⍺n} of vectors of V is said to be linearly dependent if there exists scalars c1, c2,
…, cn ∈ F not all zero such that c1⍺1 + c2⍺2 + … + cn⍺n = 0.
Note:A subset S={(x1 ,x2 ,x3),(y1 ,y2 ,y3),(z1 ,z2 ,z3)} of V3(R) is linearly
dependent iff
x1 𝑥2 𝑥3
|𝑦1 𝑦2 𝑦3 | = 0
𝑧1 𝑧2 𝑧3
Problems:
1) Show that the vectors (1,1,-1), (2,-3,5) and (-2,1,4) of R3 are linearly independent.
Solution: Consider
1 1 −1
| 2 −3 5 | = 1(−12 − 5) − 1(8 + 10) − 1(2 − 6)
−2 1 4
= −17 − 18 + 4 = −31 ≠ 0
Maxima program:
kill(all)$
A:matrix([1,1,-1],[2,-3,5],[-2,1,4]);
D:determinant(A);
if (D=0) then
disp("The given vectors are Linearly Dependent")
else
disp("The given vectors are Linearly Independent")$
Output:
2) Examine whether the set of vectors {(1,1,2), (-3,1,0), (1,-1,1), (1,2,-3)} are linearly
independent or linearly dependent.
⇒ 𝑎 − 3𝑏 + 𝑐 + 𝑑 = 0……………………..(1)
⇒ 𝑎 + 𝑏 − 𝑐 + 2𝑑 = 0……………………..(2)
⇒ 2𝑎 + 𝑐 − 3𝑑 = 0…………………………(3)
Maxima program:
kill(all)$
v1:[1,1,2]$
v2:[-3,1,0]$
v3:[1,-1,1]$
v4:[1,2,-3]$
e:c1*v1+c2*v2+c3*v3+c4*v4$
h:linsolve([e[1]=0,e[2]=0,e[3]=0],[c1,c2,c3,c4]);
if (c1=0)and (c2=0) and (c3=0)and(c4=0) then
disp("The given vectors are Linearly Independent")
else
disp("The given vectors are Linearly Dependent")$
Output:
3) Examine whether the vectors (1,√2,1), (1,-√2,1) and (-1,0,1) of V3(R) are linearly
independent.
4) In V3(R) show that the set of vectors {(1,1,0), (1,3,2),(4,9,5)} are linearly dependent.
Note: If a vector space V has a basis consisting of finite number of elements then the
vector space V is said to be finite dimensional vector space.
Problems:
(1) Show that the vectors (1,1,0), (0,1,0), (0,1,1) form a basis of R3
Solution: dim(R3)=3.
Let S={(1,1,0), (0,1,0), (0,1,1)}
⇒ |𝑆| = 3 = dim (R3 )
∴ S is linearly independent ⇒ S is a basis of R3
1 1 0
Consider, |A|=|0 1 0| = 1(1 − 0) − 1(0) + 0(0) = 1 ≠ 0
0 1 1
Therefore S is Linearly independent and hence form a basis of R3
Maxima program:
kill(all)$
A:matrix([1,1,0],[0,1,0],[0,1,1]);
D:determinant(A);
if(D=0)then
2) Show that the set of vectors {(1,2,3),(3,1,0),(-2,1,3)} is not a basis of R3.Determine the
dimension and basis of the subspace spanned by the given vectors.
1 2 3
Let A=[ 3 1 0],
−2 1 3
|A|= 1(3-0)-2(9-0)+3(3+2)
=3-18+15=0.
∴ The given set of vectors are Linearly dependent and hence not a basis of R3 .
1 2 3
Consider, A=[ 3 1 0] , 𝑅2 − 3𝑅1, 𝑅3 + 2𝑅1
−2 1 3
1 2 3
~ [0 −5 −9], 𝑅3 + 𝑅2
0 5 9
1 2 3
−1
~ [0 −5 −9], 5 𝑅2
0 0 0
1 2 3
~ [0 1 9/5]
0 0 0
There are 2 nonzero rows.
∴Rank of A=2.
Hence the dimension of the subspace is 2.
9
Basis of the subspace is {(1, 2, 3) , (0, 1, 5
)}.
Maxima program:
kill(all)$
A:matrix([1,2,3],[3,1,0],[-2,1,3]);
D:determinant(A);
if(D=0)then
disp("The given vectors are Linearly Dependent and hence do not form a basis")
else
disp("The given vectors are Linearly Independent and hence form a basis")$
r:rank(A)$
3) Find the basis and dimension of the subspace spanned by the vectors
(2,-3,1), (3,0,1), (0,2,1), (1,1,1) of R3.
2 −3 1
Let 𝐴 = [3 0 1], 𝑅1 ↔ 𝑅4 ,
0 2 1
1 1 1
1 1 1
~ [3 0 1], 𝑅2 − 3𝑅1 , 𝑅4 − 2𝑅1
0 2 1
2 −3 1
1 1 1
~[ 0 −3 −2 ] , (−1/3)𝑅2
0 2 1
0 −5 −1
1 1 1
0 1 2/3
~[ ] , 𝑅3 − 2𝑅2, 𝑅4 + 5𝑅2,
0 2 1
0 −5 −1
1 1 1
0 1 2/3
~[ ], (−3)𝑅3 ,
0 0 −1/3
0 0 7/3
1 1 1
0 1 2/3
~[ ] , 𝑅4 + 7𝑅3
0 0 1
0 0 7/3
1 1 1
0 1 2/3
~[ ]
0 0 1
0 0 0
There are 3 non zero rows.
∴Rank of A=3.
Hence the dimension of the subspace is 3.
Maxima program:
kill(all)$
A:matrix([2,-3,1],[3,0,1],[0,2,1],[1,1,1]);
r:rank(A)$
print("Dimension of the subspace is=",r)$
e:echelon(A)$
disp("Subspace is generated by")$
for i:1 thru r do(disp(e[i]))$
Output:
(4) Find the dimension and basis of the subspace generated by the vectors
1 −5 1 1 2 −4 1 −7
( ),( ),( ),( ) of the vector space of all 2x2
−4 2 −1 5 −5 7 −5 1
matrices over R.
LINEAR TRANSFORMATION
Definition:
Let U and V be finite dimensional vector spaces over the same field F.
OR
Let U and V be finite dimensional vector spaces over the same field F.
Problems:
Maxima program:
kill(all)$
T(x):=[x[1]+x[2], x[2]];
A:[a,b]$
B:[c,d]$
a1:T(A)+T(B);
a2:T(A+B);
p1:factor(T(k*A));
p2:k*T(A);
if (a1=a2 and p1=p2) then
print("The given mapping is a linear transformation")
else
print("The given mapping is not a linear transformation")$
Output:
(1)≠(2)
Therefore T is not a linear transformation.
Maxima program:
kill(all)$
T(x):=[x[1]^2+x[1]*x[2],x[1]*x[2],x[2]*x[3]];
A:[a,b,c]$
B:[d,e,f]$
a1:T(A)+T(B);
a2:radcan(T(A+B));
p1:factor(T(k*A));
p2:factor(k*T(A));
if (a1=a2 and p1=p2) then
print("The given mapping is a linear transformation")
else
print("The given mapping is not a linear transformation")$
Output:
Maxima program:
kill(all)$
T(x):=[x[1]+2*x[2]-3*x[3],4*x[1]-5*x[2]+6*x[3]];
A:[a,b,c]$
B:[d,e,f]$
a1:T(A)+T(B);
a2:radcan(T(A+B));
p1:factor(T(k*A));
p2:factor(k*T(A));
if (a1=a2 and p1=p2) then
print("The given mapping is a linear transformation")
else
print("The given mapping is not a linear transformation")$
Output:
Maxima program:
kill(all)$
T(x):=[x[1]+3,2*x[2],x[1]+x[2]];
Then the matrix formed by taking the transpose of the coefficient matrix
1
Solution: Given 𝑇(𝑥, 𝑦, 𝑧) = (𝑥 − 𝑦 + 𝑧, 2𝑥 + 3𝑦 − 2 𝑧, 𝑥 + 𝑦 − 2𝑧)
𝐵1 = {(−1,1,0), (5, −1,2), (1,2,1)}
T(-1,1,0)=(-2,1,0),
T(5,-1,2) =(8,6,0),
T(1,2,1) = (0,15/2,1).
Consider (−2,1,0) = 𝑐1 (1,1,0) + 𝑐2 (0,0,1) + 𝑐3 (1,5,2)-----(1)
Equation (1) gives,
𝑐1 + 𝑐3 = −2 ---------(a)
𝑐1 + 5𝑐3 = 1--------(b)
𝑐2 + 2𝑐3 = 0-------(c)
from (b)-(a), we get 4𝑐3 =3 ⟹ 𝑐3 =3/4,
if 𝑐3 =3/4 then we get 𝑐1 =-11/4 and 𝑐2 =-3/2
Similarly,
(8,6,0) = 𝑘1 (1,1,0) + 𝑘2 (0,0,1) + 𝑘3 (1,5,2)------(2)
Equation (2) gives,
𝑘1 + 𝑘3 = 8---------(a1)
𝑘1 + 5𝑘3 = 6--------(b1)
𝑘2 + 2𝑘3 = 0-------(c1)
from (b1)-(a1), we get 4𝑘3 =-2, ⟹ 𝑘3 =-1/2,
if 𝑘3 =-1/2 then 𝑘1 =17/2 and 𝑘2 =1
Now consider,
(0,15/2,1) = 𝑟1 (1,1,0) + 𝑟2 (0,0,1) + 𝑟3 (1,5,2)------(3)
Equation (3) gives,
𝑟1 + 𝑟3 = 0---------(a2)
𝑟1 + 5𝑟3 = 15/2--------(b2)
𝑟2 + 2𝑟3 = 1-------(c2)
from (b2)-(a2), we get 4𝑟3 =15/2, ⟹ 𝑟3 =15/8,
if 𝑟3 =15/8 then 𝑟1 =-15/8 and 𝑟2 =-11/4
Therefore the matrix of a linear transformation T is
−11 17 −15
𝑐1 𝑘1 𝑟1 4 2 8
−3 −11
𝐴 = [𝑐2 𝑘2 𝑟2 ] = 2
1 4
𝑐3 𝑘3 𝑟3 3×3 3 −1 15
[ 4 2 8 ]3×3
Maxima Program:
kill(all)$
T(x):=[x[1]-x[2]+x[3],2*x[1]+3*x[2]-(1/2)*x[3],x[1]+x[2]-2*x[3]];
u[1]:[-1,1,0]$
u[2]:[5,-1,2]$
2) Find the matrix of linear transformation T:V2(R) ⟶ V3(R) defined by 𝑇(𝑥, 𝑦) = (−𝑥 +
2𝑦, 𝑦, −3𝑥 + 3𝑦) relative to the basis
B1={(1,2), (-2,1)} and B2={(-1,0,2), (1,2,3),(1,-1,-1)}.
3)Find the matrix of linear transformation T:V3(R) ⟶ V2(R) defined by relative to the basis
𝑇(𝑥1 , 𝑥2 , 𝑥3 ) = (𝑥1 + 𝑥2 , 𝑥2 + 𝑥3 ) B1={(1,1,0), (1,0,1),(1,1,-1)} and B2={(2,-3), (1,4)}.
Maxima Program:
kill(all)$
n:3; /*dimension of Domain*/
m:2; /*dimension of Codomain*/
T(x):=[x[1]+x[2], x[2]+x[3]];
u[1]:[1,1,0]$
u[2]:[1,0,1]$
u[3]:[1,1,-1]$
v[1]:[2,-3]$
v[2]:[1,4]$
for i:1 thru m do(
eq[i]:v[1][i]*x+v[2][i]*y)$
for k:1 thru n do(
soln:solve([eq[1]=T(u[k])[1],eq[2]=T(u[k])[2]],[x,y]),
p[k]:ev(x,soln),
q[k]:ev(y,soln));
print("The matrix of linear transformation is A :")$
A:matrix([p[1],p[2],p[3]],[q[1],q[2],q[3]]);
T:U⟶V where both U and V are finite dimensional vector spaces of dimension m and n respectively.
Let 𝐵1 = {𝛼1 , 𝛼2 , … , 𝛼𝑚 } & 𝐵2 = {𝛽1 , 𝛽2 , … , 𝛽𝑛 } be the ordered basis of U & V
respectively. Define the linear transformation T:U⟶V by defining T on the vectors of B1 as 𝑇(𝛼𝑖 ) =
𝑎1𝑖 𝛽1 + 𝑎2𝑖 𝛽2 + ⋯ + 𝑎𝑛𝑖 𝛽𝑛
−1 0
1) Find the linear transformation for the matrix [ 2 0] with respect to the bases B1 = {(1,0),
1 3
(2,-1)} and B2 = {(1,2,0), (0,-1,0),(1,-1,1)}
Program:
kill(all)$
A:matrix([-1,0],[2,0],[1,3]);
u[1]:[1,0]$
u[2]:[2,-1]$
v[1]:[1,2,0]$
v[2]:[0,-1,0]$
v[3]:[1,-1,1]$
Output:
2 3
2)Given the matrix [ ] of linear transformation T, find T w.r.t the basis and B1 = {(1,-1), (1,1)
4 −5
}and B2 = {(1,0), (0,1)}.
3)Find the linear transformation T w.r.t the standard basis, given the matrix of
1 0 1
linear transformation A=[ 2 1 1 ].
−1 1 −2
If R(T) is finite dimensional then dimension of R(T) is known as Rank of T and it is denoted by
r(T).
N(T) = {α ∈ U/ T(α) = 0′}, where 0’ is the zero vector of V is known as Kernel of T or Null space
of T.
If N(T) is finite dimensional then dimension of N(T) is known as Nullity of T and denoted n(T)
Rank-Nullity Theorem:
If T:U⟶V is a linear transformation and U is finite dimensional vector space then dim R(T) +dim
N(T) = dim(U) i.e, r(T) + n(T) = dim(U) or
Problems:
T(e2)=(2,0,1) and T(e3)=(1,1,1) then find range space, rank and nullity of T and hence verify rank-
nullity theorem.
1 −1 0
Consider the matrix 𝐴 = [2 0 1] , 𝑅2 − 2𝑅1 , 𝑅3 − 𝑅1
1 1 1
1 −1 0
~ [0 2 1], 𝑅3 − 𝑅2 ,
0 2 1
1 −1 0
~ [0 2 1].
0 0 0
There are 2 non zero rows.
Therefore Rank(A) = 2.
Dimension of the range space = 𝑟(𝑇) = 2
Basis of 𝑅(𝑇) = {(1, −1,0), (0,2,1)}
Range space 𝑅(𝑇) = {𝑥(1, −1,0) + 𝑦(0,2,1) ⋮ 𝑥, 𝑦 ∈ 𝑅}
Output:
T(e2)=(0,1,1) and T(e3)=(1,2,1) then find range space, rank and nullity of T and hence verify rank-
nullity theorem.
1 1 0
Consider the matrix 𝐴 = [0 1 1] , 𝑅3 − 𝑅1
1 2 1
1 1 0
~ [0 1 1], 𝑅3 − 𝑅2 ,
0 1 1
1 1 0
~ [0 1 1].
0 0 0
There are 2 non zero rows.
Therefore Rank(A) = 2.
Dimension of the range space = 𝑟(𝑇) = 2
Basis of 𝑅(𝑇) = {(1,1,0), (0,1,1)}
Range space is given by 𝑅(𝑇) = {𝑥(1,1,0) + 𝑦(0,1,1) ⋮ 𝑥, 𝑦 ∈ 𝑅}
= {(𝑥, 𝑥 + 𝑦, 𝑦) ⋮ 𝑥, 𝑦 ∈ 𝑅}
Let 𝑇(𝑥, 𝑦, 𝑧) = (0,0,0)
⟹ (𝑥 + 𝑧, 𝑥 + 𝑦 + 2𝑧, 𝑦 + 𝑧) = (0,0,0)
⟹𝑥+𝑧 =0, 𝑥 + 𝑦 + 2𝑧 = 0, 𝑦 + 𝑧 = 0.
⟹ 𝑥 = −𝑧, 𝑦 = −𝑧, 𝑧=𝑧
Therefore the null space is 𝑁(𝑇) = {(−𝑧, −𝑧, 𝑧) ⋮ 𝑧 ∈ 𝑅}
= {𝑧(−1, −1,1) ⋮ 𝑧 ∈ 𝑅}
Basis of 𝑁(𝑇) = {(−1, −1,1)}
Therefore Nullity 𝑛(𝑇) = 1,
𝑟(𝑇) + 𝑛(𝑇) = 2 + 1 = 3 = 𝑑𝑖𝑚(𝑅 3 )
Hence Rank nullity theorem is verified.
T(e2)=(1,0,1) and T(e3)=(0,1,1) then find range space, rank and nullity of T and hence verify rank-
nullity theorem.
T(e2)=(1,-1,0) and T(e3)=(0,0,1) then find range space, rank and nullity of T and hence verify rank-
nullity theorem.
1 1 2
Consider the matrix 𝐴 = [1 −1 0] , 𝑅2 − 𝑅1
0 0 1
2. E v a l u a t e 𝛾(9⁄ )
2
kill(all)$
n:9/2;
gamma(n);
𝜸(𝟓⁄𝟐)
4. E v a l u a t e
𝜸(𝟏⁄𝟐)
kill(all)$
n:5/2;
m:1/2;
gamma(n)/gamma(m);
kill(all)$
n:1/2;
m:5/2;
k:3/2;
gamma(n)*gamma(m)*gamma(k);
Program:
kill(all)$
n:7/3;
m:4/3
gamma(n)/gamma(m);
𝜸(𝟑)𝜸(𝟓⁄𝟐)
7. Evaluate
𝜸(𝟏𝟏⁄𝟐)
Program:
kill(all)$
k:3;
n:5/2;
m:11/2
(gamma(3)*gamma(n))/gamma(m);
∞ −𝒙 𝟒
8. E v a l u a t e ∫𝟎 𝒆 𝒙 𝒅𝒙
∞ −𝒙 𝟕
9. E v a l u a t e ∫𝟎 𝒆 𝒙 𝒅𝒙
5
2. 𝛽(7⁄ , ⁄ )
2 2
Program:
kill(all)$
beta(7/2,5/2);
𝟏𝟐
4. Evaluate∫𝟎 𝒙 (𝟏 − 𝒙) 𝒅𝒙
𝟑
𝟏 𝟑⁄
5. Evaluate ∫𝟎 𝒙 𝟐
√𝟏 − 𝒙 𝒅𝒙
Program:
kill(all)$
P(x,y):=x+2*y$
Q(x,y):=x-2*y$
s:diff(Q(x,y),x)-diff(P(x,y),y)$
Z:integrate(integrate(s,x,0,1),y,0,1);
F1:[P(1,y),Q(1,y)].[diff(1,x),diff(y,y)]$
I1:integrate(F1,y,0,1);
F2:[P(0,y),Q(0,y)].[diff(1,x),diff(y,y)]$
I2:integrate(F2,y,1,0);
F3:[P(x,1),Q(x,1)].[diff(x,x),diff(1,y)]$
I3:integrate(F3,x,1,0);
F4:[P(x,0),Q(x,0)].[diff(x,x),diff(1,y)]$
I4:integrate(F4,x,0,1);
if Z=I1+I2+I3+I4 then
disp("Green's theorem is verified for the given problem")
else
disp("Green's theorem is not verified for the given problem")$
3. Verify Green’s theorem for ∫𝑐(3𝑥 2 − 8𝑦 2 )𝑑𝑥 + (4𝑦 − 6𝑥𝑦 )𝑑𝑦 where
c is the curve bounded by 𝑦 = 𝑥 2 𝑎𝑛𝑑 𝑥 = 𝑦 2 .
Program:
Note: Write the manual part on the ruled side and Maxima program &
Output on the unruled side of the record.