Both ED and low testosterone (hypogonadism) increase with age. The incidence of the latter is 40% in men aged 45 years and older.  Testosterone is known to be important in mood, cognition, vitality, bone health, and muscle and fat composition. It also plays a key role in sexual dysfunction (eg, low libido, poor erection quality, ejaculatory or orgasmic dysfunction, reduced spontaneous erections, or reduced sexual activity). 
Vitamin D and zinc are both essential to testosterone production. A year-long study looked at the vitamin D and testosterone levels of 2299 men. It found that men with vitamin D levels above 30 nmol/L had more testosterone and lower levels of sex hormone-binding globulin (SHBG). SHBG binds to hormones so your cells can’t use them, and if you have too much of it, your testosterone levels drop . Men with vitamin D deficiency had lower testosterone and higher SHBG levels.
Present in much greater levels in men than women, testosterone initiates the development of the male internal and external reproductive organs during foetal development and is essential for the production of sperm in adult life. This hormone also signals the body to make new blood cells, ensures that muscles and bones stay strong during and after puberty and enhances libido both in men and women. Testosterone is linked to many of the changes seen in boys during puberty (including an increase in height, body and pubic hair growth, enlargement of the penis, testes and prostate gland, and changes in sexual and aggressive behaviour). It also regulates the secretion of luteinising hormone and follicle stimulating hormone. To effect these changes, testosterone is often converted into another androgen called dihydrotestosterone.
Dr. Adriane Fugh-Berman, associate professor of pharmacology and director of the industry watchdog group PharmedOut.org at Georgetown University School of Medicine, calls this kind of direct-to-consumer pharmaceutical advertising "evil." She likened the efforts to sell TRT to earlier campaigns to push hormone replacement therapy for post-menopausal women. "They stole the playbook," she said. "This hormone is being thrown around like sugar water."
^ Jump up to: a b Sapienza P, Zingales L, Maestripieri D (September 2009). "Gender differences in financial risk aversion and career choices are affected by testosterone". Proceedings of the National Academy of Sciences of the United States of America. 106 (36): 15268–73. Bibcode:2009PNAS..10615268S. doi:10.1073/pnas.0907352106. PMC 2741240. PMID 19706398.
The effects of testosterone in humans and other vertebrates occur by way of multiple mechanisms: by activation of the androgen receptor (directly or as DHT), and by conversion to estradiol and activation of certain estrogen receptors. Androgens such as testosterone have also been found to bind to and activate membrane androgen receptors.
When stimulated by the nerves, the spongy tissue arranges itself in such a way that more blood can be stored in the penis. The veins running through the outer sheath of the penis then compress which stops the blood from leaving the penis. As the blood is stopped from flowing out, the penis fills with blood and stretches within the outer casing, giving an erection.
With sex therapy, your counselor looks at the sexual problems you and your partner are having. Sex therapy works with problems such as performance anxiety, which means that you worry so much about whether you will be able to have sex that you are not able to. It also helps when you have erection problems that are not due to physical or drug problems, or premature ejaculation (you come too quickly). It may help you to reach orgasm or to learn to relax enough to avoid pain during sex. Counseling can help you to adjust to the treatment you and your doctor choose.
Most men may not openly talk about their erection problems, but erectile dysfunction — when a man cannot achieve or maintain an erection well enough or long enough to have satisfying sex — is very common. According to the National Institutes of Health, 5 percent of 40-year-olds and 15 to 25 percent of 65-years old have ED. But while ED is more likely to occur as a man gets older, it doesn’t come automatically with age.
Trials of testosterone treatment in men with type 2 diabetes have also taken place. A recent randomized controlled crossover trial assessed the effects of intramuscular testosterone replacement to achieve levels within the physiological range, compared with placebo injections in 24 men with diabetes, hypogonadism and a mean age of 64 years (Kapoor et al 2006). Ten of these men were insulin treated. Testosterone treatment led to a significant reduction in glycated hemoglobin (HbA1C) and fasting glucose compared to placebo. Testosterone also produced a significant reduction in insulin resistance, measured by the homeostatic model assessment (HOMA), in the fourteen non-insulin treated patients. It is not possible to measure insulin resistance in patients treated with insulin but five out of ten of these patients had a reduction of insulin dose during the study. Other significant changes during testosterone treatment in this trial were reduced total cholesterol, waist circumference and waist-hip ratio. Similarly, a placebo-controlled but non-blinded trial in 24 men with visceral obesity, diabetes, hypogonadism and mean age 57 years found that three months of oral testosterone treatment led to significant reductions in HbA1C, fasting glucose, post-prandial glucose, weight, fat mass and waist-hip ratio (Boyanov et al 2003). In contrast, an uncontrolled study of 150 mg intramuscular testosterone given to 10 patients, average age 64 years, with diabetes and hypogonadism found no significant change in diabetes control, fasting glucose or insulin levels (Corrales et al 2004). Another uncontrolled study showed no beneficial effect of testosterone treatment on insulin resistance, measured by HOMA and ‘minimal model’ of area under acute insulin response curves, in 11 patients with type 2 diabetes aged between 33 and 73 years (Lee et al 2005). Body mass index was within the normal range in this population and there was no change in waist-hip ratio or weight during testosterone treatment. Baseline testosterone levels were in the low-normal range and patients received a relatively small dose of 100 mg intramuscular testosterone every three weeks. A good increase in testosterone levels during the trial is described but it is not stated at which time during the three week cycle the testosterone levels were tested, so the lack of response could reflect an insufficient overall testosterone dose in the trial period.
Surgery: If neither drugs nor the vacuum pump works, your doctor may suggest surgery. With surgery, the doctor can place a device in your penis that will cause enough hardness for intercourse. In a few cases, infections may develop after the operation, and the doctor may have to remove the device. Another operation that may help you is rebuilding the blood vessels in the penis to increase blood flow into the penis or decrease blood flow out of the penis. These procedures can help you to get and maintain an erection.
Replacement therapy may produce desired results, such as greater muscle mass and a stronger sex drive. However, the treatment does carry some side effects. Oily skin and fluid retention are common. The testicles may also shrink, and sperm production could decrease significantly. Some studies have found no greater risk of prostate cancer with testosterone replacement therapy, but it continues to be a topic of ongoing research.
^ Mehta PH, Jones AC, Josephs RA (Jun 2008). "The social endocrinology of dominance: basal testosterone predicts cortisol changes and behavior following victory and defeat" (PDF). Journal of Personality and Social Psychology. 94 (6): 1078–93. CiteSeerX 10.1.1.336.2502. doi:10.1037/0022-35184.108.40.2068. PMID 18505319. Archived from the original (PDF) on April 19, 2009.
If a young man's low testosterone is a problem for a couple trying to get pregnant, gonadotropin injections may be an option in some cases. These are hormones that signal the body to produce more testosterone. This may increase the sperm count. Hedges also describes implantable testosterone pellets, a relatively new form of treatment in which several pellets are placed under the skin of the buttocks, where they release testosterone over the course of about three to four months. Injections and nasal gels may be other options for some men.
If PDE5 drugs don't work or cannot be used because of potential side effects, your doctor can recommend other therapies. The drug alprostadil (Caverject, Edex, Muse) allows blood to flow more freely in the penis, leading to an erection. The drug can be injected with a tiny needle into your penis. Or, a small pellet (suppository) can be inserted into the opening of the penis. Suppositories and injections are effective in the majority of men.
^ Jump up to: a b Travison TG, Vesper HW, Orwoll E, Wu F, Kaufman JM, Wang Y, Lapauw B, Fiers T, Matsumoto AM, Bhasin S (April 2017). "Harmonized Reference Ranges for Circulating Testosterone Levels in Men of Four Cohort Studies in the United States and Europe". The Journal of Clinical Endocrinology and Metabolism. 102 (4): 1161–1173. doi:10.1210/jc.2016-2935. PMC 5460736. PMID 28324103.
Treatment depends on the underlying cause. In general, exercise, particularly of the aerobic type, is effective for preventing ED during midlife. Exercise as a treatment is under investigation.:6, 18–19 For tobacco smokers, cessation often results in a significant improvement. Oral pharmacotherapy and vacuum erection devices are first-line treatments,:20, 24 followed by injections of drugs into the penis, as well as penile implants.:25–26 Vascular reconstructive surgeries are beneficial in certain groups.
Testosterone replacement therapy may improve energy, mood, and bone density, increase muscle mass and weight, and heighten sexual interest in older men who may have deficient levels of testosterone. Testosterone supplementation is not recommended for men who have normal testosterone levels for their age group due to the risk of prostate enlargement and other side effects. Testosterone replacement therapy is available as a cream or gel, topical solution, skin patch, injectable form and pellet form placed under the skin.
In one study, 9.6% reported ‘occasional’ erectile dysfunction, 8.9% reported erectile dysfunction occurring ‘often’, and 18.6% reported erectile dysfunction occurring ‘all the time’. Of these, only 11.6% had received treatment.In another study, only 14.1% of men reported that they had received treatment, despite experiencing erectile dysfunction for longer than 12 months.
Miscellaneous: Sleep: (REM sleep) increases nocturnal testosterone levels. Behavior: Dominance challenges can, in some cases, stimulate increased testosterone release in men. Drugs: Natural or man-made antiandrogens including spearmint tea reduce testosterone levels. Licorice can decrease the production of testosterone and this effect is greater in females.
However, in contrast, a recent systematic review of published studies, the authors concluded that overall, the addition of testosterone to PDE-5 inhibitors might benefit patients with ED associated with testosterone levels of less than 300 ng/dL (10.4 nmol/L) who failed monotherapy.  A limitation of existing studies are their heterogeneous nature and methodological drawbacks.
A physical exam checks your total health. Examination focusing on your genitals (penis and testicles) is often done to check for ED. Based on your age and risk factors, the exam may also focus on your heart and blood system: heart, peripheral pulses and blood pressure. Based on your age and family history your doctor may do a rectal exam to check the prostate. These tests are not painful. Most patients do not need a lot of testing before starting treatment.
In order to establish whether normal erections are occurring overnight (nocturnal erections), the doctor may organise nocturnal penile tumescence (NPT) testing. This involves wearing a monitor overnight in your own home. The data from this monitor is then assessed to analyse how often erections occurred, how long they lasted, and how rigid and large the penis was during the erections. If NPT testing is normal, the cause of erectile dysfunction is usually psychological. If not, further testing of the blood flow in the genital area may be required to see if there is blockage or leakage. The doctor may also organise a blood test of levels of hormones such as testosterone, prolactin and thyroid stimulating hormone to see if these are contributing to the erectile dysfunction.
An occasional problem achieving an erection is nothing to worry about. But failure to do so more than 50% of the time at any age may indicate a condition that needs treatment. About 40% of men in their 40s report at least occasional problems getting and maintaining erections. So do more than half (52%) of men aged 40 to 70, and about 70% of men in their 70s.
Regardless of the method of testosterone treatment chosen, patients will require regular monitoring during the first year of treatment in order to monitor clinical response to testosterone, testosterone levels and adverse effects, including prostate cancer (see Table 2). It is recommended that patients should be reviewed at least every three months during this time. Once treatment has been established, less frequent review is appropriate but the care of the patient should be the responsibility of an appropriately trained specialist with sufficient experience of managing patients treated with testosterone.
The amount of testosterone synthesized is regulated by the hypothalamic–pituitary–testicular axis (see figure to the right). When testosterone levels are low, gonadotropin-releasing hormone (GnRH) is released by the hypothalamus, which in turn stimulates the pituitary gland to release FSH and LH. These latter two hormones stimulate the testis to synthesize testosterone. Finally, increasing levels of testosterone through a negative feedback loop act on the hypothalamus and pituitary to inhibit the release of GnRH and FSH/LH, respectively.
"Bring back the younger inner you," says the Low T Center. According to its website, its president, Mr. (notably not "Dr.") Mike Sisk, "created these centers out of a need." They promise their testosterone injections "do not just help boost a low sex drive but can also boost energy, decrease body fat, irritability, and depression." They go so far as to claim that "research finds testosterone replacement can solve long-term health issues like Alzheimer's and heart disease."