In theoretical physics and mathematical physics, analytical mechanics, or theoretical mechanics is a collection of closely related alternative formulations of classical mechanics. It was developed by many scientists and mathematicians during the 18th century and onward, after Newtonian mechanics. Since Newtonian mechanics considers vector quantities of motion, particularly accelerations, moment, forces, of the constituents of the system, an alternative name for the mechanics governed by Newton’s laws and Euler’s laws is vectorial mechanics.

By contrast, analytical mechanics uses scalar properties of motion representing the system as a whole—usually its total kinetic energy and potential energy—not Newton’s vectorial forces of individual particles. A scalar is a quantity, whereas a vector is represented by quantity and direction. The equations of motion are derived from the scalar quantity by some underlying principle about the scalar’s variation.

Analytical mechanics take advantage of a system’s constraints to solve problems. The constraints limit the degrees of freedom the system can have and can be used to reduce the number of coordinates needed to solve for the motion. The formalism is well suited to arbitrary choices of coordinates, known in the context as generalized coordinates. The kinetic and potential energies of the system are expressed using these generalized coordinates or momenta, and the equations of motion can be readily set up, thus analytical mechanics allows numerous mechanical problems to be solved with greater efficiency than fully vectorial methods. It does not always work for non-conservative forces or dissipative forces like friction, in which case one may revert to Newtonian mechanics or use the Udwadia–Kalaba equation.

Two dominant branches of analytical mechanics are Lagrangian mechanics (using generalized coordinates and corresponding generalized velocities in configuration space) and Hamiltonian mechanics (using coordinates and corresponding momenta in phase space). Both formulations are equivalent to a Legendre transformation on the generalized coordinates, velocities and momenta, therefore both contain the same information for describing the dynamics of a system. There are other formulations such as Hamilton–Jacobi theory, Routhian mechanics, and Appell’s equation of motion. All equations of motion for particles and fields, in any formalism, can be derived from the widely applicable result called the principle of least action. One result is Noether’s theorem, a statement which connects conservation laws to their associated symmetries.

Analytical mechanics does not introduce new physics and is not more general than Newtonian mechanics. Rather it is a collection of equivalent formalisms which have broad application. In fact, the same principles and formalisms can be used in relativistic mechanics and general relativity, and with some modification, quantum mechanics and quantum field theory.

Analytical mechanics is used widely, from fundamental physics to applied mathematics, particularly chaos theory. The methods of analytical mechanics apply to discrete particles, each with a finite number of degrees of freedom. They can be modified to describe continuous fields or fluids, which have infinite degrees of freedom. The definitions and equations have a close analogy with those of mechanics.