We consider the linear quadratic regulator (LQR) for linear constant-coefficient delay differential equations (DDEs) with multiple delays. The Hamiltonian approach is used instead of an algebraic Riccati partial differential equation. Two coupled DDEs governing the state and control input are derived using the calculus of variations. This coupled system, with infinitely many roots in both left and right half-planes, defines a boundary value problem. Its left half-plane roots are the exact closed-loop poles of the controlled system. These closed-loop poles have not been used to compute the optimal feedback before. Here, the distributed delay kernel that yields exactly those poles is first computed using an eigenfunction expansion. Increasing the number of terms in the truncated expansion yields a highly oscillatory kernel. However, the oscillatory kernel's antiderivative converges to a piecewise smooth function on the delay interval plus a Dirac delta function at zero. Discontinuities in the kernel coincide with discrete delay values in the original DDE. Using this insight, a fitted piecewise polynomial kernel matches the exact closed-loop poles very well. The twofold contribution of the Hamiltonian approach is thus clarity on the form of the feedback kernel as well as the exact closed-loop poles. Subsequently, the fitted piecewise polynomial kernel can be used for a much simpler control calculation. The polynomial coefficients can be fitted by solving a few simultaneous linear equations. Two detailed numerical examples of the LQR for DDEs, one with two delays and one with three delays, show excellent results.