Erectile dysfunction can occur as a side effect of medication taken for another health condition. Common culprits are high blood pressure meds, antidepressants, some diuretics, beta-blockers, heart medication, cholesterol meds, antipsychotic drugs, hormone drugs, corticosteroids, chemotherapy, and medication for male pattern baldness, among others.
Conditions associated with reduced nerve and endothelium function (eg, aging, hypertension, smoking, hypercholesterolemia, and diabetes) alter the balance between contraction and relaxation factors (see Pathophysiology). These conditions cause circulatory and structural changes in penile tissues, resulting in arterial insufficiency and defective smooth muscle relaxation. In some patients, sexual dysfunction may be the presenting symptom of these disorders.
There are no formal tests to diagnose erectile dysfunction. Some blood tests are generally done to exclude underlying disease, such as hypogonadism and prolactinoma. Impotence is also related to generally poor physical health, poor dietary habits, obesity, and most specifically cardiovascular disease such as coronary artery disease and peripheral vascular disease. Therefore, a thorough physical examination is helpful, in particular the simple search for a previously undetected groin hernia since it can affect sexual functions in men and is easily curable.
A useful and simple way to distinguish between physiological and psychological impotence is to determine whether the patient ever has an erection. If never, the problem is likely to be physiological; if sometimes (however rarely), it could be physiological or psychological. The current diagnostic and statistical manual of mental diseases (DSM-IV) has included a listing for impotence.
Erectile dysfunction is clearly a symptom of many conditions, and certain risk factors have been identified, some of which may be amenable to prevention strategies. Diabetes mellitus, hypogonadism in association with a number of endocrinologic conditions, hypertension, vascular disease, high levels of blood cholesterol, low levels of high density lipoprotein, drugs, neurogenic disorders, Peyronie's disease, priapism, depression, alcohol ingestion, lack of sexual knowledge, poor sexual techniques, inadequate interpersonal relationships or their deterioration, and many chronic diseases, especially renal failure and dialysis, have been demonstrated as risk factors. Vascular surgery is also often a risk factor. Age appears to be a strong indirect risk factor in that it is associated with an increased likelihood of direct risk factors. Other factors require more extensive study. Smoking has an adverse effect on erectile function by accentuating the effects of other risk factors such as vascular disease or hypertension. To date, vasectomy has not been associated with an increased risk of erectile dysfunction other than causing an occasional psychological reaction that could then have a psychogenic influence. Accurate risk factor identification and characterization are essential for concerted efforts at prevention of erectile dysfunction.
How men can improve their sexual performance Many men want to know how to enhance their own and their partners’ sexual satisfaction. However, placing too much emphasis on performance can lead to anxiety. Certain lifestyle changes can help to reduce sexual anxiety, improve erectile dysfunction, and increase stamina. In this article, we describe 13 methods to try. Read now
Is your erectile dysfunction due to psychological (stress, relationship problems, etc.) or physical factors? Your doctor may ask if you note erections at night or in the early morning. Men have involuntary erections in the early morning and during REM sleep (a stage in the sleep cycle with rapid eye movements). Men with psychogenic erectile dysfunction (erectile dysfunction due to psychological factors such as stress and anxiety rather than physical factors) usually maintain these involuntary erections. Men with physical causes of erectile dysfunction (for example, atherosclerosis, smoking, and diabetes) usually do not have these involuntary erections. Men with psychogenic erectile dysfunction may relate the onset of problems to a "stressor," such as failed relationship. Your doctor may suggest a test to determine if you have erections during sleep, which may suggest that there may be a psychological cause of the erectile dysfunction.
early 15c., "physical weakness," also "poverty," from Middle French impotence "weakness," from Latin impotentia "lack of control or power," from impotentem (nominative impotens); see impotent. In reference to a want of (male) sexual potency, from c.1500. The figurative senses of the word in Latin were "violence, fury, unbridled passion." Related: Impotency.
In the meantime, make sure he gets some rest and takes it easy. The more you two stress about it — and the more pressure he feels you are putting on him — the harder it will get for him to get hard, in all likelihood. So take a few days off. Relax, be patient, and help him find him some help if he needs it. In the meantime, here's a Cosmopolitan.com guide about exactly this topic from sex therapist Dr. Jane Greer.
Stress is another factor that can be a cause or effect of ED. If you're stressed at work, at home, and in your relationships, it's going to take a toll on your sexual function. Your mind is elsewhere, and relaxing when you finally make it between the sheets is a long shot. Now you’re stressed because you can’t get it up (talk about the ultimate catch-22), so you're stuck in this sad, frustrating cycle. “ED really affects the psyche of a guy, regardless of the etiology, Gittens says. “If you have a problem getting an erection one night, you’re probably going to be anxious and worried your partner might see you as less of a man the next time you try to get an erection.” There's a pill that will help with this, and it's not promoted on television with middle-aged men in sports cars. It's a damn chill pill.
Psychological factors — Psychological issues such as depression, anxiety, guilt or fear can sometimes cause sexual problems. At one time, these factors were thought to be the major cause of impotence. Doctors now know that physical factors cause impotence in most men with the problem. However, embarrassment or "performance anxiety" can make a physical problem worse.
Patients with both ED and cardiovascular disease who receive treatment with an oral PDE5 inhibitor require education regarding what to do if anginal episodes develop while the drug is in their system. Such education includes stressing the importance of alerting emergency care providers to the presence of the drug so that nitrate treatment is avoided.
One study examined the role of testosterone supplementation in hypogonadal men with ED. These men were considered nonresponders to sildenafil, and their erections were monitored by assessing nocturnal penile tumescence (NPT). After these men were given testosterone transdermally for 6 months, the number of NPTs increased, as did the maximum rigidity with sildenafil.  This study suggests that a certain level of testosterone may be necessary for PDE5 inhibitors to function properly.
In comparison, 37% of men who had received external radiotherapy as their primary therapy reported the ability to attain functional erections suitable for intercourse, along with 43% of men who had received brachytherapy as primary treatment. Pretreatment sexual health-related quality of life score, age, serum prostate-specific antigen (PSA) level, race or ethnicity, body mass index, and intended treatment details were associated with functional erections 2 years after treatment. 
Most of us are raised to believe that men are ravenous sex-beasts, eternally horny and only pretending to be a part of polite society so that they can find some new crevice to jam their Jeremy Irons into. So the first time we cross paths (and genitals) with a guy who can't get an erection, many of us immediately panic and assume that the problem must be us. We must be profoundly unsexy. After all, what could else possibly stop these hormone-addled maniacs from getting an erection?
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). 
If you just got off solo, you might have to wait before you can hop into bed with your partner, says Dr. Brahmbhatt. It might have something to do with a spike in the hormone prolactin after you orgasm, according to a study published in the International Journal of Impotence Research. This hormone has been linked to difficulties maintaining an erection or even ejaculating.
Tadalafil shares the common side effects of the PDE5 inhibitors, however, due to its effect on PDE11, another phosphodiesterase located in muscle, tadalafil has been associated with muscle aches. Back pain and muscle aches occur in less than 7% of men taking tadalafil and in most patients will go away without treatment within 48 hours. When treatment was necessary, acetaminophen (Tylenol) and nonsteroidal anti-inflammatory drugs (NSAIDs) such as ibuprofen (Motrin, Advil) or naproxen (Aleve) were effective. Rarely do the muscle aches and back pain cause men to stop using tadalafil.