Final answer:
Mediastinitis arises from infections in the neck and thorax, as these compartments can spread infection to the mediastinum, a central area within the thoracic cavity.
Step-by-step explanation:
Mediastinitis is an infection of the mediastinum, a space within the thoracic cavity located between the lungs. The compartments that can give rise to mediastinitis due to infection are the neck (cervical) area and the thorax (thoracic cavity). Infections in these areas can spread to the mediastinum, which houses vital structures such as the heart, trachea, and esophagus. It is not typically associated with infections originating from the abdominal cavity, pelvic cavity, or retroperitoneal space.