Problem 1

ds = (Sqrt[(r^2)+((z'[θ])^2)])

D[ds,z[θ]]

D[ds,z'[θ]]

D[D[ds,z'[θ]],θ] //Simplify

eq= (r^2) z''[θ]==0

DSolve[eq,z[θ],θ][[1]]

(*Basic Helix Plot*)
ParametricPlot3D[{Cos[z],Sin[z],z},{z,0,4 Pi},
PlotStyle->Thick,
PlotLabel->"3D Helix",
AspectRatio->GoldenRatio]

Problem 3

3) Consider light passing from one medium to another with indices of refraction of {n1, n2} . Use Fermat' s
principle to minimize the time and find the resulting law of refraction .

rule1 ={   (1/(Sqrt[(b^2)+(((d-x))^2)]))->(1/L2), (1/(Sqrt[(a^2)+(x^2)])) ->(1/L1)}

rule2 ={ (((d-x))/L2)->   Sin[β],  (x/L1)->Sin[α] }

Clear["Global`*"]

time1 =(( (Sqrt[(a^2)+(x^2)]))/v1);
time2 =(( (Sqrt[(b^2)+(((d-x))^2)]))/v2);
time=time1+time2

dtime= D[time,x]

dtime //.rule1

eq= dtime //.rule1 //.rule2

Problem 4

Without Lagrange Multiplier :

Clear["Global`*"]

kin=(1/2)m (((x'[t])^(2 ))+α (r^2) ((θ'[t])^2))

pot=- m g x[t] Sin[ϕ]

lag=kin-pot

constraint = r θ[t] == x[t]

dsol= DSolve[constraint, θ,t][[1]]

lag = lag  /.dsol //Simplify

eq= D[D[lag,x'[t]],t] - D[lag ,x[t]]

sol=Solve[eq==0,x''[t]][[1]]

sol  /.{α->0}

With Lagrange Multiplier :

Clear["Global`*"]

kin=(1/2)m (((x'[t])^(2 ))+α (r^2) ((θ'[t])^2))

pot=- m g x[t] Sin[ϕ]

lag=kin-pot

constraint = r θ[t] - x[t]

D[constraint,θ[t]]

D[constraint,x[t]]

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

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

eqConstraint=D[constraint,{t,2}]==0

eqs={eqx,eqθ,eqConstraint }

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

sol  /.{α->0}

Problem 5

Clear["Global`*"]

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

pot=(1/2)k (r^2)((((θ1[t]-θ2[t]))^2)+(((θ2[t]-θ3[t]))^2)+(((θ3[t]-θ1[t]))^2)) //Simplify

lag=kin-pot

D[D[lag,θ1'[t]],t] - D[lag,θ1[t]]

D[D[lag,θ1'[t]],t]

D[lag,θ1[t]]

D[lag,θ2[t]]

D[lag,θ3[t]]

tmat=DiagonalMatrix[{1,1,1}];
vmat={{2,-1,-1},{-1,2,-1},{-1,-1,2}};

MatrixForm /@ {tmat,vmat}

mat = k vmat - w2 tmat;
mat //MatrixForm

eval= Solve[Det[mat]==0,w2]

eq1=(mat /.eval[[1]]).{a1,a2,a3}=={0,0,0} //Thread

sol1= Solve[eq1,{a1,a2,a3}]

eq2=(mat /.eval[[2]]).{a1,a2,a3}=={0,0,0} //Thread

sol2= Solve[eq2,{a1,a2,a3}]

evec1={a1,a2,a2} /.sol1[[1]]  /.{a1->1}

evec2={a1,a2,a2} /.sol2[[1]] /.{a1->1,a2->-1}

evec3=Cross[evec1,evec2]

emat= Normalize /@{evec1,evec2,evec3}

emat= Orthogonalize[{evec1,evec2,{1,2,3}}] //Simplify

emat.Transpose[emat] //MatrixForm

emat.tmat.Transpose[emat] //MatrixForm

emat.vmat.Transpose[emat] //Simplify//MatrixForm