Farwa Maskeen
F21BMAT009
Assignment 2
Software Package
12th March 2023
Question # 1
Plot[{Sin[x], Cos[x]}, {x, 0, 2 π}, PlotLegends → "Expressions"]
1.0
0.5
sin(x)
1 2 3 4 5 6 cos(x)
-0.5
-1.0
Question # 2
In[2]:= Plot[2 Sin[x] + x, {x, 0, 15}, Filling → Bottom]
15
10
Out[2]=
2 4 6 8 10 12 14
2 ASSIGN 2 mathe (1).nb
Question # 3
Cos[x] - 1
Plot , {x, - 2 π, 2 π}
Sin[x]
-6 -4 -2 2 4 6
-2
-4
-6
Question # 4
1
PlotTan[x] × CosSin , {x, - 2 π, 2 π}, Frame → True
x
6
-2
-4
-6
-6 -4 -2 0 2 4 6
ASSIGN 2 mathe (1).nb 3
Question # 5
In[3]:= Plotx - 2 ^ 2, x ^ 3, {x, - 3, 3}, PlotStyle → {Dashed, Thickness[0.02]}
30
20
10
Out[3]=
-3 -2 -1 1 2 3
-10
-20
-30
Question # 6
Plot3D 1 - x ^ 2 - y ^ 2 , {x, - 2, 2}, {y, - 2, 2}
4 ASSIGN 2 mathe (1).nb
Question # 7
x
Plot3D 2
, {x, - 2, 2}, {y, - 2, 2}, PlotRange → All, ColorFunction → "Rainbow"
ⅇx + y2
Question # 8
Plot3Dx2 - y2 , {x, - 3, 3}, {y, - 3, 3},
BoundaryStyle → { Purple, Directive[Thickness[0.01]]}
ASSIGN 2 mathe (1).nb 5
Question # 9
In[4]:=
A=1 2
3 4
B = A*A
MatrixForm[B]
Out[4]= {{1, 2}, {3, 4}}
Out[5]= {{1, 4}, {9, 16}}
Out[6]//MatrixForm=
1 4
9 16
Question # 10
A = DiagonalMatrix[{1, 2, 3, 4}]
MatrixForm[A]
{{1, 0, 0, 0}, {0, 2, 0, 0}, {0, 0, 3, 0}, {0, 0, 0, 4}}
1 0 0 0
0 2 0 0
0 0 3 0
0 0 0 4
Question # 11
1 2 3
MatrixRank 4 5 6
7 8 9
2
Question # 12
1 2 3
In[7]:= A= 4 5 6
7 8 9
B = UpperTriangularize [A] // MatrixForm
Out[7]= {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
Out[8]//MatrixForm=
1 2 3
0 5 6
0 0 9
6 ASSIGN 2 mathe (1).nb
Question # 13
1 2 3
In[9]:= A= 4 5 6
7 8 9
B = LowerTriangularize[A] // MatrixForm
Out[9]= {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
Out[10]//MatrixForm=
1 0 0
4 5 0
7 8 9