This study derived the analytical solutions for the deflection, bending moment and shear force of a hard roof under an arbitrary front abutment pressure for both the initial and periodic fracture problems using the elastic foundation beam model. With the assumption that the overburden pressure is constant in a small section, the roof subjected to arbitrarily distributed pressures is divided into a number of sufficiently small sections, whose closed-form solutions can be obtained easily. The proposed analytical solutions are validated by comparisons with those calculated using a model reported in the literature, in which the overburden pressure is assumed to follow a normal distribution. The parametric studies on the foundation stiffness, front abutment pressure and support resistance show that: (1) with the decrease of elastic foundation stiffness, the deflection and the maximum bending moment significantly increase, and the shear force significantly changes in the unmined region; (2) as the peak point position moves inside the coal wall, the deflection of the goaf roof, as well as the maximum bending moment and shear force, obviously decrease; (3) with the increase of support resistance, the maximum bending moment and deflection significantly decrease, and the shear force significant decreases in the hydraulic support region; (4) when the coal seam is soft and peak position of the front abutment pressure is near the coal wall, initial fracture occurs at the midspan; otherwise, it occurs inside the coal wall. For the periodic fracture condition, the fracture position is closer to the coal wall when the coal seam is harder, and the fracture length increases when the peak position of front abutment pressure moves inside the coal wall.