  Given bounded selfadjoint operators $A$ and $B$ acting on a Hilbert space
$\mathcal{H}$, consider the linear pencil $P(\lambda)=A+\lambda B$,
$\lambda\in\mathbb{R}$. The set of parameters $\lambda$ such that $P(\lambda)$
is a positive (semi)definite operator is characterized. These results are
applied to solving a quadratic programming problem with an equality quadratic
constraint (or a QP1EQC problem).
