body that is not point-like, with density ρ, we have instead: where integration runs over the area of the body, and Iz is the moment of inertia around the z-axis. Thus, assuming the potential energy does not depend on ωz (this assumption may fail for electromagnetic systems), we have the angular momentum of the ith object: We have thus far rotated each object by a separate angle; we may also define an overall angle θz by which we rotate the whole system, thus rotating also each object around the z-axis, and have the overall angular momentum: From Euler–Lagrange equations it then follows that: Since the lagrangian is dependent upon the angles of the object only through the potential, we have: which is the torque on the ith object. Suppose the system is invariant to rotations, so that the potential is independent of an overall rotation by the angle θz (thus it may depend on the angles of objects only through their differences, in the form ). We therefore get for the total angular momentum: And thus the angular momentum around the z-axis is conserved. This analysis can be repeated separately for each axis, giving conversation of the angular momentum vector. However, the angles around the three axes cannot be treated simultaneously as generalized coordinates, since they are not independent; in particular, two angles per point suffice to determine its position. While it is true that in the case of a rigid body, fully describing it requires, in addition to three translational degrees of freedom, also specification of three rotational degrees of freedom; however these cannot be defined as rotations around the Cartesian axes (see Euler angles). This caveat is reflected in quantum mechanics in the non-trivial commutation relations of the different components of the angular momentum operator. In Hamiltonian formalism Equivalently, in Hamiltonian mechanics the Hamiltonian can be described as a function of the angular momentum. As before, the part of the kinetic energy related to rotation around the z-axis for the ith object is: which is analogous to the energy dependence upon momentum along the z-axis, . Hamilton's equations relate the angle around the z-axis to its conjugate momentum, the angular momentum around the same axis: The first equation gives And so we get the same results as in the Lagrangian formalism. Note, that for combining all axes together, we write the kinetic energy as: where pr is the