Problem 1 :

Plot3D[Im[Sqrt[x+I y]],{x,-4,4},{y,-4,4}]

Plot3D[Re[Sqrt[x+I y]],{x,-4,4},{y,-4,4}]

Plot3D[Im[(((x+I y))^(1/3))],{x,-4,4},{y,-4,4}]

Plot3D[Re[(((x+I y))^(1/3))],{x,-4,4},{y,-4,4}]

Cube Root

(((r Exp[I θ]))^(1/3)) //PowerExpand

ϵ=0.001;
(((r Exp[I θ]))^(1/3)) /.{r->1, θ->{π-ϵ,-π+ϵ}}

Sin[π/3] //N

p1=Plot[{ ((Abs[r])^(1/3))Sin[ (π/3)],-((Abs[r])^(1/3))Sin[ (π/3)]} //Re ,{r,-4,0},PlotStyle->Red]

p2=Plot[{ (r^(1/3))Exp[I (π/3)],-(r^(1/3))Exp[I (π/3)]} //Im ,{r,-4,0},PlotStyle->{Green,Thickness[0.012]}]

Show[p2,p1,PlotRange->All]

General Root

(((r Exp[I θ]))^(1/n)) //PowerExpand

{n->Table[i,{i,2,10,1}]}

ϵ=0.001;
tab= Table[i,{i,2,10,1}]
(((r Exp[I θ]))^(1/n)) /.{r->1, θ->{π-ϵ,-π+ϵ}} /.{n->tab} //Transpose//TableForm[#,TableHeadings->{tab, None}]&

Table[Sin[π/n] //N,{n,2,10,1}]

Exp[I π/4] //Im

Sin[π/4]

Clear[p1,p2]
p1[n_]:=Plot[{ ((Abs[r])^(1/n))Sin[ (π/n)],-((Abs[r])^(1/n))Sin[ (π/n)]} //Re ,{r,-4,0},PlotStyle->Red]
p2[n_]:=Plot[{ ((Abs[r])^(1/n))Exp[I (π/n)],-((Abs[r])^(1/n))Exp[I (π/n)]} //Im ,{r,-4,0},PlotStyle->{Green,Thickness[0.012]}]

Do[
Print[n];
Show[p2[n],p1[n]] //Print
,{n,2,10}]

Problem 2 :

Clear["Global`*"]

mat={{14,-3},{-3,6}};
mat //MatrixForm

Eigenvalues[mat] //Simplify
Eigenvectors[mat]

Tr[mat]

Det[mat]

Eigenvalues[mat] //Simplify

b=Eigenvectors[mat]

b = Normalize /@ b

b.Transpose[b]

test= b.mat.Transpose[b]  //Simplify//MatrixForm

Problem 3 :

Clear["Global`*"]

tmat = (1/2)m (r^2)(((θ1'[t])^2)+((θ2'[t])^2)+((θ3'[t])^2))

tt=(1/2)m (r^2)DiagonalMatrix[{1,1,1}];
tt //MatrixForm

vmat = (k/2)(r^(2 ))((((θ1-θ2))^2)+(((θ2-θ3))^2)+(((θ3-θ1))^2))

vmat //Expand

test1= (vmat/(k (r^2))) //Expand

D[test1,θ1]

vv={{2,-1,-1},{-1,2,-1},{-1,-1,2}};
vv //MatrixForm

Det[{{2,-1,-1},{-1,2,-1},{-1,-1,2}}]

vec={θ1,θ2,θ3};

MatrixForm /@ {vec,vv,vec }

test2=(1/(2 ))vec.vv.vec //Expand

test1==test2

D[test1,θ1]

vvmat=k (r^2)vv;
vvmat //MatrixForm

tt  (-2 w2) //MatrixForm

mat1= vvmat + tt  (-2 w2)

Det[mat1]

Det[mat1] /.{w2->0}

Solve[Det[mat1]==0,w2]

Problem 2: f[x_]=...  for x=[0,2 π]

Clear["Global`*"]

Part a)

Clear[f];
f[x_]:=1 /; 0< x <= N[Pi/2];
f[x_]:=0 /; N[Pi/2] < x <= N[Pi];
f[x_]:=1 /; N[Pi] < x <= N[3 Pi/2];
f[x_]:=0 /; N[3 Pi/2] < x <= N[2Pi];

Plot[f[x],{x,0,2 Pi}]

Compute the Fourier coefficients

a[n_]=(1/π)(Integrate[ Cos[n x],{x,0,π/2}]+Integrate[ Cos[n x],{x,π,3π/2}]) //Simplify

a[n_]=(1/π)(Integrate[ Cos[n x],{x,0,π/2}]+Integrate[ Cos[n x],{x,π,3π/2}]) //Simplify[#,n∈Integers]&

Table[a[i],{i,1,10,1}]

Check

(1/π)(Integrate[ 1,{x,0,π/2}]+Integrate[ 1,{x,π,3π/2}])

b[n_]=(1/π)(Integrate[ Sin[n x],{x,0,π/2}]+Integrate[ Sin[n x],{x,π,3π/2}])  //Simplify

b[n_]=(1/π)(Integrate[ Sin[n x],{x,0,π/2}]+Integrate[ Sin[n x],{x,π,3π/2}]) //FullSimplify[#,n∈Integers]&

Table[b[i],{i,1,10,1}]

Compute the Fourier coefficients

(* Note the integration limits  *)
(* Note, my function here is just "x"  You will need to change in other problems. *)
(* Note, we often need to do the zero term separately *)

c[0]= 1/(2 Pi)(  Integrate[ 1  ,{x,0, Pi/2}]+   Integrate[ 1  ,{x,Pi, 3Pi/2}] )

c[m_]= 1/(2 Pi)( Integrate[ 1 Exp[- I m x] ,{x,0, Pi/2}] +  Integrate[ 1 Exp[- I m x] ,{x,Pi, 3Pi/2}]  )//FullSimplify

Integrate[ 1 Exp[- I m x],x]

Integrate[ 1 Sin[ m x],x]

Integrate[ 1 Sin[ m x],{x,0,π/2}]+Integrate[ 1 Sin[ m x],{x,π,3π/2}]//FullSimplify

Table[c[i],{i,0,6}]//Simplify

term[0]= c[0];

term[m_]= c[m] Exp[I m x] + c[-m]  Exp[-I m x]  //FullSimplify

series[n_]:= Sum[ term[m] ,{m,0,n}]

series[2]

Plot the series with different numbers of terms

Plot[ Join[{f[x]},Table[series[i],{i,2,10,1}] ] //Evaluate
  ,{x,0,2 Pi},PlotStyle->colors]

Plot[ {f[x], series[100] } //Evaluate ,{x,0,2 Pi}]

Make  a "frequency domain" plot of the coefficients

coeffs=Table[{Re[c[i]],Im[c[i]]},{i,0,10}] //Flatten

BarChart[coeffs,ChartStyle->{Red,Blue},ChartLabels->{"Re","Im"}]

Re-write the Exp series as a Trig series

term2[0] = term[0] //ExpToTrig //Simplify

term2[m_]= term[m] //ExpToTrig //Simplify

tmp= term[m] //ExpToTrig // FullSimplify[#, Element[m, Integers]] &

series2[n_]:= Sum[ term2[m] ,{m,0,n}]

series[5]

series[10]  //ExpToTrig //TrigReduce

series2[10] //TrigReduce

((2 series2[40])/4) //TrigReduce //Expand

Verify that they are identical

series2[10]-series[10] //FullSimplify

Problem

Clear["Global`*"]

λ1={{0,1,0},{1,0,0},{0,0,0}};
λ2={{0,-I,0},{I,0,0},{0,0,0}};
λ3={{1,0,0},{0,-1,0},{0,0,0}};
λ4={{0,0,1},{0,0,0},{1,0,0}};
λ5={{0,0,-I},{0,0,0},{I,0,0}};
λ6={{0,0,0},{0,0,1},{0,1,0}};
λ7={{0,0,0},{0,0,-I},{0,I,0}};
λ8=1/Sqrt[3] {{1,0,0},{0,1,0},{0,0,-2}};

MatrixForm /@ {λ1,λ2,λ3,λ4,λ5,λ6,λ7,λ8}

comm[a_,b_]=a.b-b.a

tmp= comm[λ1,λ4];
tmp //MatrixForm

tmp  //MatrixForm

I λ7 //MatrixForm

comm[λ1,λ2] //MatrixForm

λ1.λ4 //MatrixForm

comm[λ1,λ4] == I λ7