Abstract. We study linear Hamiltonian systems using bilinear and quadratic differential forms. Such a representation-free approach allows us to use the same concepts and techniques to deal with systems isolated from their environment and with systems subject to external influences and allows us to study systems described by higher-order differential equations, thus dispensing with the usual point of view in classical mechanics of considering first-and second-order differential equations only.Key words. linear Hamiltonian systems, two-variable polynomial matrices, bilinear and quadratic differential forms, behavioral system theory AMS subject classifications. 93A10, 93A30, 93C05, 37J99, 70H50 DOI. 10.1137/S03630129024146641. Introduction. This paper aims to give a unified treatment of linear Hamiltonian systems using the formalism of bilinear and quadratic differential forms introduced in [24]. We consider systems with and without external influences, and we deal with both cases using the same techniques and the same concepts. Moreover, we formulate concepts and study the properties of Hamiltonian systems in a representation-free way, thus dispensing with the usual point of view in mechanics and in physics (see, for example, [1]) of concentrating on first-order representations in the (generalized) coordinates and the (generalized) momenta. Instead of postulating the existence of a function (the Lagrangian, or the Hamiltonian) on the basis of physical considerations (conservation of energy, etc.) and deducing from such a function the equations of motion, we proceed by assuming that a set of linear differential equations with constant coefficients describing the system is given, and we deduce the Hamiltonian nature of the system from such equations, by proving the existence of certain bilinear functionals of the variables of the system and of their derivatives satisfying some additional property. Our approach is of a system-theoretic nature rather than derived from the study of mechanics: as happens in optimal control theory for linear systems, we consider the interplay of (quadratic and bilinear) functionals of the system variables and of the equations of motion as the central object of study when dealing with Hamiltonian systems.In this paper we also reconcile our point of view with that of classical mechanics by showing how to construct a "generalized Lagrangian" on the basis of the equations of the system, in the sense that the trajectories of the system are stationary with respect to such a quadratic functional of the variables of the system and their derivatives. In this context, the concept of internal force also arises naturally from the equations describing the system: in this paper we show that generalized internal forces can be defined which depend on higher-order derivatives of the external variables and not only first-order ones at most, as happens in classical mechanics.