I am working through a problem that's asking me to calculate the Hamiltonian of a free particle in polar coordinates moving in two dimensions. I believe I have the correct form of the equation, however I seem to have picked up a term of $\frac{1}{2}$ somewhere and I can't find where. If anyone can help me to see where my error is I would appreciate it. My work is below. Thanks!
Lagrangian given by $$L = T + V = T$$ Where $V = 0$ since free particle. Now $$T = \frac{1}{2}m(\dot{x}^2 + \dot{y}^2)$$ Where, in polar coordinates: $$x = r\cos\theta\\ y =r\sin\theta\\ \dot{x} = \dot{r}\cos\theta - r\sin\theta\dot{\theta}\\ \dot{y} = \dot{r}\sin\theta + r\cos\theta\dot{\theta}$$ Thus the kinetic energy is given by $$T = \frac{1}{2}m(\dot{r}^2\cos^2{\theta} + r^2\sin^2\theta\dot{\theta}^2 - 2r\dot{r}\cos\theta\sin\theta\dot{\theta} + \dot{r}^2\sin^2{\theta} + r^2\cos^2\theta\dot{\theta}^2 + 2r\dot{r}\cos\theta\sin\theta\dot{\theta}) = \frac{1}{2}m(2(\dot{r}^2 + r^2\dot{\theta^2}) = m\dot{r}^2 + mr^2\dot{\theta}^2$$ Now calculating the conjugate momenta $p_i = \frac{\partial{L}}{\partial{\dot{q}_i}}$ $$p_r = 2m\dot{r} \implies \dot{r} - \frac{p_r}{2m}\\ p_\theta = 2mr^2\dot{\theta}^2 \implies \dot{\theta} = \frac{p_\theta}{2mr^2}$$ Now the Hamiltonian is given by $H = T + V = T$ since free particle we substitute the values for $\dot{r}\ \dot{\theta}$ in terms of their conjugate momenta into the expression for $T = m\dot{r}^2 + mr^2\dot{\theta}^2$ we got above to find: $$H = T = m\dot{r}^2 + mr^2\dot{\theta}^2 = m(\frac{p_r}{2m})^2 + mr^2(\frac{p_\theta}{2mr^2})^2 = m\frac{p_r^2}{4m^2} + mr^2\frac{p_\theta^2}{4m^2r^4} = \frac{p_r^2}{4m} + \frac{p_\theta^2}{4mr^2}$$ Where I'm pretty sure the correct answer is $$\frac{p_r^2}{2m} + \frac{p_\theta^2}{2mr^2}$$ So I picked up an extra $\frac{1}{2}$ term somewhere, I'm just not sure where exactly.
You picked up a factor of $2$ because you used $\sin^2+\cos^2=2$ instead of $\sin^2+\cos^2=1$ in calculating $T$.