Aging is directly related to sleep problems. Primary insomnia has a negative impact on the lives of elderly adults, altering cognitive and metabolic functions. Physical activity is positively related to improvement in sleep quality. The systematic and continuous practice of physical exercise significantly improves perceived sleep quality in elderly individuals. Therefore, physical activities can be used as a tool to prevent sleep disorders and improve health in general.
The increased longevity of the world’s population is related to changes in sleep patterns 
. These changes serve as a tool for assessing the quality of life and are directly linked to some organic issues, such as physical and mental health, well-being and general vitality 
. Many studies show that changes in sleep patterns have a negative impact on cognitive function and quality of life 
Aging can be characterized as a time-dependent process of losing organic functions, and the brain is not spared. Sleep, dependent on several pathways and mechanisms, also has its full functioning altered 
. The ability to initiate and maintain sleep is compromised, and the electroencephalogram shows less deep sleep. These changes may be associated with reduced white matter density, reduced gray matter volume in some regions, diminishment in functional synapses and impact on the production and degradation of neurotransmitters and neuropeptides [4,5]
Middle age is directly related to an increased prevalence of common sleep problems, such as insomnia 
. Sleep patterns change with aging. The duration of the more superficial phases of sleep increases, while the durations of deep and Rapid Eye Movement (REM) sleep decrease. For this reason, sleep is less restorative for elderly adults, and they are more vulnerable to being awakened by external stimuli 
. The production of melatonin, an important regulator of sleep, is decreased in the elderly 
The association between insomnia and decreased quality of life is most notable in elderly adults 
. Sleep disorders affect metabolism, causing weight gain between early adulthood and old age and simultaneously promoting metabolic and immunological disorganization and the resulting emergence of some diseases, such as hypertension, diabetes mellitus, cancer and depression 
Sleep disorders are underdiagnosed and undertreated, and more than half of the individuals affected do not receive any type of treatment to resolve the condition 
. The approach to insomnia in elderly adults is usually complex and multifactorial. In addition to primary insomnia, adverse effects of drugs, psychiatric diseases and other comorbidities can be direct or aggravating causes. Conventional treatment consists of mitigating secondary causes, cognitive-behavioral therapy and medications. However, the risk of treatment failure is still high, and the main drug treatments cause side effects such as dizziness, memory loss, falls, daytime sleepiness and disinhibition 
. There are less expensive and effective ways to treat this problem that can be added to conventional treatment.
The performance of physical exercise is a positive step toward changes in lifestyle and may comprise a nonpharmacological treatment for sleep disorders and their organic consequences 
. One way to evaluate sleep quality is using the Pittsburgh Sleep Quality Index (PSQI). This index evaluates sleep quality through a standardized questionnaire consisting of 19 items grouped into 7 components based on sleep in the past month and is able to differentiate between those who sleep well and those who sleep poorly 
2. Physical Exercise on Sleep Quality in Elderly Adults
Physical activity had a favorable effect on sleep. There was a significant positive effect of exercise on sleep quality in the exercise group compared to the control group, as measured using the PSQI. However, there was no significant difference in the improvement of sleep quality between the group with insomnia and the group without insomnia.
Rubio-Arias  et al., in a study evaluating middle-aged women, found different results according to the exercise protocol applied: while there was no significant improvement in groups that performed low-intensity exercise (yoga), groups that engaged in moderate exercise (aerobic exercise) showed improvement in sleep quality. Xie et al. , in a systematic review of 22 randomized clinical trials that inclluded adults over 18 years of age, showed that overall, both classical exercises (walking, cycling) and mind–body exercises (yoga) improved sleep quality to the same degree.
The mechanisms by which exercise affects sleep are still widely discussed. Hughes et al.  reported that exercise improves the circadian cycle in mice through VIP and GABA signaling on clock cells. The effect of exercise on melatonin secretion is controversial, with some studies showing that exercise increased melatonin secretion in the short term  and others showing that nocturnal exercise decreased  or did not affect the secretion of this hormone . According to Uchida et al. , exercise causes increased secretion of brain-derived neurotrophic factor (BDNF) and growth hormone. However, as the same autscholars also emphasized, the effects of these exercise-related changes need further study.
Sleep quality can be positively impacted through the release of molecules secreted from myocytes and adipocytes in response to exercise [47,48]
. Changes in leptin and ghrelin levels are associated with sleep disorders, and physical exercise modulates their levels 
. Exercise increases the muscle expression of BDNF, Irisin, IL-6 and TNF-α. These substances have circadian behavior and, in animal experiments, change the depth of slow-wave sleep and the total sleep duration 
. According to Abd El-Kader, IL-6 and TNF-α levels significantly reduce after aerobic training 
Physical activity can improve sleep by regulating the circadian cycle, which is often altered with aging. Physical exercise can work like a Zeitgeber, adjusting the biological clock 
. Aging decreases parasympathetic tone, while exercise can modulate vagus nerve activity, increasing parasympathetic tone. This function can be associated with improved sleep quality both by neural mechanism and by altering blood pressure levels and heart rate 
. Physical exercise impacts not only the circadian fluctuations of cortisol but also the density of receptors for this hormone on brain and muscle tissue, decreasing tissular sensitivity to glucocorticoids and increasing its metabolic degradation rate 
Future studies may deepen the comparison between aerobic and resistance exercises, compare the elements of the PSQI in addition to the overall score, use objective measures of sleep quality (such as polysomnography parameters), evaluate the dose–response relationship in a more elaborate way and include more participants with a diagnosis of primary insomnia.
Physical exercise improves sleep quality in both patients with previous complaints of insomnia and patients without previous complaints and has few adverse effects, making it a valuable adjuvant approach in the treatment of elderly patients with complaints of insomnia that may even reduce the number of medications used to sleep. Nevertheless, many of the studies included in the review had a high risk of bias, and they used very different interventions, which compromised the ability to generalize the results
. Further studies are needed to investigate a greater number of participants diagnosed with insomnia, compare aerobic and resistance exercises, and use other scores of sleep quality.