I am given a perturbative action $$\frac{S}{\mathcal{T}}=\int dt\sum _{n=0,1} (\dot{c_n}{}^2-c_n^2 \omega _n^2)+7.11 c_0^3+35.3 c_0 c_1^2+4.66 c_0 \dot{c_0}{}^2+1.32 c_0 \dot{c_1}{}^2-7.57 \dot{c_0} c_1 \dot{c_1}$$ ($\omega _0^2=-1.4$ and $\omega _1^2=7.57$).
\[Omega]sq[0] = -1.4; \[Omega]sq[1] = 7.57;
lagrangian =
Sum[c[n]'[t]^2 - c[n][t]^2 \[Omega]sq[n], {n, {0, 1}}] +
7.11 c[0][t]^3 + 35.3 c[0][t] c[1][t]^2 +
4.66 c[0][t] c[0]'[t]^2 + 1.32 c[0][t] c[1]'[t]^2 -
7.57 c[0]'[t] c[1][t] c[1]'[t];
I tried finding the hamiltonian by hand and found out it to be equal to:
H[t_] = c[0]'[t]^2 + c[1]'[t]^2 + 4.66 c[0][t] c[0]'[t]^2 +
1.32 c[0][t] c[1]'[t]^2 - 7.57 c[0]'[t] c[1][t] c[1]'[t] -
1.40 c[0][t]^2 + 7.57 c[1][t]^2 - 7.11 c[0][t]^3 -
35.3 c[0][t] c[1][t]^2;
How shall I use Mathematica to verify the above result?