  For linear Hamiltonian $2n\times 2n$ systems $J y'(x) = (\lambda
W(x)+H(x))y(x)$ we investigate the problem how the eigenvalues $\lambda$ depend
on the entries of the coefficient matrix $H$. This question turns into a
deformation equation for $H$ and a partial differential equation for the
eigenvalues $\lambda$. We apply our results to various examples, including
generalizations of the confluent Heun equation and the Chandrasekhar-Page
angular equation. We are mainly concerned with the $2\times 2$ case, and in
order to reduce the degrees of freedom in $H$ as much as possible, we will
first convert such systems into a complementary triangular form, which is a
canonical form with a minimum number of free parameters. Furthermore, we
discuss relations to monodromy preserving deformations and to matrix Lax pairs.
