PART - A
#L(q,\dot{q},t)=m/2[\dot{q}^2\sin^2\omegat+\dot{q}q\omega\sin(2\omegat)+q^2\omega^2]#......(EQ0)
Step 1: First calculate the generalized momentum-
#p\equiv(\frac{\delL}{\del\dot{q}}) = m/2[2\dot{q}\sin^2\omegat+qw\sin(2\omegat)]#...... (EQ1)
Step 2: Next, invert (1) and write #\dot{q}# in terms of #p# and #q# -
#\dot{q}(p,q) = [p/(m\sin^2\omegat)-(q\omega)/(\tan\omegat)]# ...... (EQ2)
For later convenience we also find expressions for #\dot{q}\sin\omegat# and #\dot{q}^2\sin^2\omegat#.
#\dot{q}\sin\omegat = [ p/(m\sin\omegat)-q\omega\cos\omegat ]#......(EQ3)
#\dot{q}^2\sin^2\omegat = [p^2/(m^2\sin^2\omegat) + q^2\omega^2\cos^2\omegat]# ......(EQ4)
Step 3: Rewrite the Lagrangian as a function of #q#, #p# and #t#,
Let us rewrite the Lagrangian in a form that would make it easy to replace #\dot{q}# with #p#,
#L(q,\dot{q},t) = m/2[(\dot{q}\sin\omegat)^2+2\omegaq(\dot{q}\sin\omegat)\cos\omegat+q^2\omega^2]#
Substitute EQ3 and EQ4 for the terms in parentheses in the above equation, simplify and rearrange -
#L(q,p,t) = m/2[p^2/(m^2\sin^2\omegat) + q^2\omega^2\sin^2\omegat]# ...... (EQ4)
Step 4: Perform a Legendre transformation and construct the Hamiltonian,
#H(q,p,t) \equiv p\dot{q}(q,p)-L(q,p,t);#
Substituting EQ2 and EQ4 in the above relation, simplifying and rearranging,
#H(q,p,t) = [p^2/(2m\sin^2\omegat) - (pq\omega)/(\tan\omegat) - (m\omega^2q^2)/2\sin^2\omegat]# ......(EQ5)
Is the Hamiltonian conserved?: The Hamiltonian is conserved if it is not an explicit function of time. Though the above Hamiltonian seems to have some explicit terms involving time, it is not clear if
#\frac{\delH}{\delt}=0#.
I tried hard to verify if it were so. But it grows monstrous to the point where I had to give up and start wondering if the second part of the problem intends to teach us something regarding this ....
PART - B
#L(q,\dot{q},t)=m/2[\dot{q}^2\sin^2\omegat+\dot{q}q\omega\sin(2\omegat)+q^2\omega^2]#......(EQ0)
Introduce a new coordinate #\quad Q = q\sin\omegat;#
#\dot{Q} = \dot{q}\sin\omegat+q\omega\cos\omegat#...... (EQ6)
#\dot{Q}^2 = \dot{q}^2\sin^2\omegat+\dot{q}q\omega\sin(2\omegat) + q^2\omega^2\cos^2\omegat#
#\dot{q}^2\sin^2\omegat+\dot{q}q\omega\sin(2\omegat) = \dot{Q}^2 - q^2\omega^2\cos^2\omegat #
#\dot{q}^2\sin^2\omegat+\dot{q}q\omega\sin(2\omegat) = \dot{Q}^2 - q^2\omega^2(1-\sin^2\omegat) #
#\dot{q}^2\sin^2\omegat+\dot{q}q\omega\sin(2\omegat) + q^2\omega^2= \dot{Q}^2+ q^2\omega^2\sin^2\omegat#
#\dot{q}^2\sin^2\omegat+\dot{q}q\omega\sin(2\omegat) + q^2\omega^2= \dot{Q}^2+ \omega^2Q^2#
Observe that the left-hand-side of the above expression if the term inside the square bracket of the Lagrangian expression. Thus we rewrite the Lagrangian in terms of the new variable #Q# and its time derivative, #\dot{Q}# as -
#L(Q, \dot{Q},t) = m/2[\dot{Q}^2+\omega^2Q^2]# ...... (EQ8)
Step 1: First calculate the generalized momentum-
#P\equiv(\frac{\delL}{\del\dot{Q}})=m\dot{Q};#......(EQ9)
Step 2: Invert the above expression to write #\dot{Q}# in terms of #P# and also write the Lagrangian in terms of #Q#, #P# and #t#,
#\dot{Q} = P/m;\qquad L(Q, P, t) =[P^2/(2m)+(m\omega^2)/2Q^2]#
Step 3: Perform a Legendre transformation and construct the Hamiltonian,
#H(Q,P,t)\equiv P\dot{Q}(Q,P)-L(Q,P,t)#
Simplify the above expression
#H(Q,P,t) = P(P/m)-[P^2/(2m)+(m\omega^2)/2Q^2]#
#H(Q,P,t) = [P^2/(2m) - (m\omega^2)/2Q^2]# ...... (EQ10)
This is the desired Hamiltonian function. In this case it is obvious that the Hamiltonian is purely a function of #Q# and #P# and is not explicitly dependent on #t#. So the Hamiltonian is conserved.