In[]:=
$VersionNumber
Out[]=
13.2

ESM 5314, HW3, Saim Ehtesham Ali

Answer 1a
In[]:=
ClearAll["Global`*"];
In[]:=
R1={{1,0,0},{0,Cos[ϕ],Sin[ϕ]},{0,-Sin[ϕ],Cos[ϕ]}};​​R2={{Cos[θ],0,-Sin[θ]},{0,1,0},{Sin[θ],0,Cos[θ]}};
In[]:=
R1R2=R1.R2;​​R1R2//MatrixForm
Out[]//MatrixForm=
Cos[θ]
0
-Sin[θ]
Sin[θ]Sin[ϕ]
Cos[ϕ]
Cos[θ]Sin[ϕ]
Cos[ϕ]Sin[θ]
-Sin[ϕ]
Cos[θ]Cos[ϕ]
In[]:=
R2R1=R2.R1;​​R2R1//MatrixForm
Out[]//MatrixForm=
Cos[θ]
Sin[θ]Sin[ϕ]
-Cos[ϕ]Sin[θ]
0
Cos[ϕ]
Sin[ϕ]
Sin[θ]
-Cos[θ]Sin[ϕ]
Cos[θ]Cos[ϕ]
Clearly, R1R2 ≠ R2R1, but I will try using values of θ and ϕ to further prove
In[]:=
Aa=R1R2/.{θ->Pi/2,ϕ->Pi/2};​​Aa//MatrixForm
Out[]//MatrixForm=
0
0
-1
1
0
0
0
-1
0
In[]:=
Ba=R2R1/.{θ->Pi/2,ϕ->Pi/2};​​Ba//MatrixForm
Out[]//MatrixForm=
0
1
0
0
0
1
1
0
0
In[]:=
Aa===Ba(*Comparisonofthe2matrices,"True"indicatestheyarethesame,and"False"indicatesthattheyarenot*)
Out[]=
False
Answer 1b
For small angles, we know Sin[x] = x and Cos[x] = 1, so we use this substitution
In[]:=
Ab=N[R1R2/.{θ->1
-10
10
,ϕ->1
-10
10
,Cos[θ]1,Cos[ϕ]1}];​​Ab//MatrixForm
Out[]//MatrixForm=
1.
0.
-1.×
-10
10
1.×
-20
10
1.
1.×
-10
10
1.×
-10
10
-1.×
-10
10
1.
In[]:=
Bb=N[R2R1/.{θ->1
-10
10
,ϕ->1
-10
10
,Cos[θ]1,Cos[ϕ]1}];​​Bb//MatrixForm
Out[]//MatrixForm=
1.
1.×
-20
10
-1.×
-10
10
0.
1.
1.×
-10
10
1.×
-10
10
-1.×
-10
10
1.
In[]:=
result=Ab-Bb;​​result//MatrixForm​​
Out[]//MatrixForm=
0.
-1.×
-20
10
0.
1.×
-20
10
0.
0.
0.
0.
0.