  We present a unified approach to constrained implicit Lagrangian and
Hamiltonian systems based on the introduced concept of Dirac algebroid. The
latter is a certain almost Dirac structure associated with the Courant
algebroid on the dual $E^\ast$ to a vector bundle $E$. If this almost Dirac
structure is integrable (Dirac), we speak about a Dirac-Lie algebroid. The
bundle $E$ plays the role of the bundle of kinematic configurations
(quasi-velocities), while the bundle $E^\ast$ - the role of the phase space.
This setting is totally intrinsic and does not distinguish between regular and
singular Lagrangians. The constraints are part of the framework, so the general
approach does not change when nonholonomic constraints are imposed, and
produces the (implicit) Euler-Lagrange and Hamilton equations in an elegant
geometric way. The scheme includes all important cases of Lagrangian and
Hamiltonian systems, no matter if they are with or without constraints,
autonomous or non-autonomous etc., as well as their reductions; in particular,
constrained systems on Lie algebroids. we prove also some basic facts about the
geometry of Dirac and Dirac-Lie algebroids.
