Problem 1 :

Clear["Global`*"]

(((2 + 3I))/((4+5 I)))(6+7I)

Exp[4π/3 I] //ExpToTrig

Exp[4π/3 ] //ExpToTrig

Problem 2 :

Clear["Global`*"]

vol=(4/3)π (r^3);
D[vol,r]

Integrate[ 4 π (r^2),r]

vol = a (r^36);
D[vol,r]

Integrate[ b (r^(42-1)),r]

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

Clear["Global`*"]

Part a)

Clear[f];
f[x_]:=0 /; 0< x <= N[Pi/2];
f[x_]:=1 /; N[Pi/2] < x <= N[Pi];
f[x_]:=0 /; N[Pi] < x <= N[3 Pi/2];
f[x_]:=1 /; 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,π/2,π}]+Integrate[ Cos[n x],{x,3π/2,2π}]) //Simplify

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

Limit[a[i],i->0]

Check

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

(1/π)Integrate[ Sin[n x],{x,π/2,π}]//FullSimplify[#,n∈Integers]&

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

b[n_]=(1/π)(Integrate[ Sin[n x],{x,π/2,π}]+Integrate[ Sin[n x],{x,3π/2,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, π/2,π}]+   Integrate[ 1  ,{x, 3π/2,2π}] )

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

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

Integrate[ 1 Sin[ m x],x]

Integrate[ 1 Sin[ m x],{x,π/2,π}]+Integrate[ 1 Sin[ m x],{x,3π/2,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 4 :

Clear["Global`*"]

tkin =  (1/2)m1 ((x1'[t])^2)+(1/2)m2 ((x2'[t])^2)

vpot =(1/2)k1 ((x1[t])^2)+(1/2)k2 (((x1[t]-x2[t]))^2)+(1/2)k3 ((x2[t])^2)

lag= tkin-vpot

D[lag,x1[t]]- D[D[lag,x1'[t]],t] //Simplify

D[lag,x2[t]]- D[D[lag,x2'[t]],t] //Simplify

vv={{-k1-k2,+k2},{k2,-k2-k3}};
vv //MatrixForm

Problem 5 :

Clear["Global`*"]

g=DiagonalMatrix[{1,-1,-1,-1}];

a) CMS

pmuon={e,0,0,e};
pproton={p,0,0,-p};

p12=pmuon+pproton

s=p12.g.p12 //Simplify

(Sqrt[s]) /.{e->1000,p->275} //N

a) Proton at rest

pmuon={e,0,0,e};
pproton={mp,0,0,0};

p12=pmuon+pproton

s=p12.g.p12 //Simplify

(Sqrt[s]) /.{e->1000,p->275,mp->1} //N

Problem 6 :

Clear["Global`*"]

tkin= (1/2)m1 ((x'[t])^2)+ (1/2)β m2 (r^2)((θ'[t])^2)

vpot= - m1 g Sin[α] x[t]

lag=tkin-vpot

f= x[t]- r θ[t];
{D[f,x[t]], D[f,θ[t]]}

eqx= D[lag,x[t]]- D[D[lag,x'[t]],t] - λ D[f,x[t]]

eqθ= D[lag,θ[t]]- D[D[lag,θ'[t]],t] - λ D[f,θ[t]]

eqf=D[f,{t,2}]

eqs = {eqx,eqθ,eqf} ==0 //Thread

Solve[eqs,{x''[t],θ''[t],λ}]

Problem 7

Clear["Global`*"]

term = (Sqrt[((((x'[y])^2)+1)/y) ])

D[term,x[y]]

D[D[term,x'[y]],y]

tmp2=D[term,x'[y]] //PowerExpand

eq=tmp2^2 == (1/(2 a))

sol= Solve[eq,x'[y]]

tmp4=x'[y] /.sol[[2]]

jacobian= D[a(1-Cos[θ]),θ]

tmp5=tmp4  jacobian /.{y->a(1-Cos[θ])}

tmp6=(Sqrt[tmp5^2]) //FullSimplify //PowerExpand

tmp7 =tmp6 //TrigExpand //FullSimplify

tmp8= Integrate[ tmp7,θ]

y[θ_]=-tmp7
x[θ_]=tmp8

ParametricPlot[{x[θ],y[θ]} /.{a->1},{θ,0,6π}]