Had brain surgery for an unruptured brain aneurysm 5 weeks ago. (coiled) when can I resume my sex life and also go to the gym. Thanks?

Soon. But get a better answer from your interventionalists or neurosurgeon since they know your anatomy specifcally.
This question is. Best suited to your neurointensivist as i would hate to speculate...Good luck.
For sex—now probably. Are you symptom free? I'd be very surprised if you couldn't return to sex now, especially since the coiling was elective apparently. Start slow & take it easy in the beginning. As for the gym, you might want to wait longer. Definitely start slow and build over time. A good discussion to have with your docs. They get asked this all the time so don't be shy.