I'm an amateur so I'd advice not to take what I say as 100% truth.
I think you are too worried about your performance and therefore you can't maintain an erection.
Look at it this way, when you're masturbating, you're alone and you can do whatever you want.
When you're with your wife, you might subconsciously want to look good like a pornstar, ergo your focus is not there 100%, or you might have some psychological blockage during sex, I'm not sure.
My friend told me that some women who are virgins for a long time feel pain in during penetration because their muscles around the vagina is tight or something along that line. In order to fix it your gyno has to injected your wife with some muscle relaxant therefore making her vagina walls or something relax, making sex not painful but pretty much normal I guess. This is what my friend told me, so like I said, don't take my word for it.
Hope I helping at least a bit
how can a man lose his erection in a vagina..must be gay
this is why u should have had sex before marriage so you didn;t waste your wife's time....now that you realize you aren;t into girls
She should consult a doctor and you should go with her. It will get better with time! Do what works best for yourselves first. Use oral sex and self pleasure to get through this first bit.
What positions have you tried? Have you used lube?
Try using a **** strap or ring, it restricts the blood flow from coming out and help maintain a hard erection. i like to use it cause it helps not to ejaculate too soon also and you still are hard after you do so you can keep going to finish pleasing her
Google 'deer exercise for man' and 'deer exercise for woman'. Both of you can do these exercises. Kegel exercises can also beneficial. Use this as an adjunct therapy. There are number of websites available on these subjects.
If you have to masturbate, remember the following tips.
Do not mb with dry hand, use lubricated hand.
Do not stop breathing while doing mb.
Keep perineum( muscle between legs) relaxed. You may massage your wife's perineum.
Do not mb when you are over excited.
Do not mb when you are in a hurry. keep 20 minutes for mb. Use these tips whenever possible.