The nerves responsible for erection are located very close to the surface of the prostate. These nerves "live" in what I would liken to a blanket draped over the prostate. In a non-cancerous (benign) prostate and prostates where the cancers have been detected early and are not aggressive (low grade cancers), the nerves (the blanket) can be easily removed from the prostate and left behind. Leaving these nerves behind will hopefully allow them to function normally to produce erections in the months following the surgery. In prostates that have more advanced or involved cancer, sometimes these nerves can have cancer within them, and it is necessary to remove them along with the prostate. This follows along with the main goal of the surgery: to remove all cancer and cure the patient of their disease.
There are two bundles of nerves that run alongside the prostate. One occurs on the left and one on the right side. Every effort is made to save both nerves, but sometimes only one can be saved. This will affect the man's ability to have the same caliber of erection that he had before the operation. Some of the largest predictors of how a man's erections will be after the operation (radical prostatectomy-removal of the prostate for cancer) are the person's age (younger men have a better chance of recovering full function) and the man's ability before the operation to have normal erections. For example, a person with a history of high blood pressure and long term diabetes who is using oral medication for erections before the surgery will likely need more aggressive treatments for erectile dysfunction after the surgery than a man who functions normally without the use of medicines. Finally, the extent of prostate cancer and the surgeon's ability to spare both nerves will be another determinant.
Historically, it was believed that the full measure of a man's erectile dysfunction should not be made until one year following prostate cancer surgery. However, new literature has shed light on the fact that it may take up to two years after radical prostatectomy to regain full function. The seeming uncertainty in this recovery stems from our inability to judge or measure how and if damage to nerves occurs during the surgery. Every attempt to avoid using electrocautery during surgery (a method to control bleeding) is made to avoid damage to these nerves. Also just by manipulating or pulling on the nerve bundles without the use of electric cautery can affect their function after the operation. One thing that I thoroughly counsel my patients on before radical prostatectomy, is that their erections may not be the same as before the operation. That being said, there are plenty of medications and "good health" measures that can be taken to try to get back to their baseline function.
"Good health" measures are extremely important for not only heart health but also for prostate health and good erectile function. If a man comes to my office complaining of erectile dysfunction and he is noticeably overweight and out of shape, one of the first counseling maneuvers that I will take, in conjunction with his primary doctor, is to discuss a good diet and exercise program. Aside from the obvious cardiovascular benefits, this regimen will also improve personal confidence. Erectile function does require a great deal of positive psychology as well. When you feel confident about your body and your health, you will likely benefit from a healthier sexual lifestyle.