soooooooooo,
realistically, it's possible eh?.. right, but pragmatically... not so much. I lost 50lb in 5 months, but that was with planning/ evolving my diet as I go. Just by the nature of your "urgent" need to lose weight, I am guessing it's for a wedding, or something similar. If that is the case, I am also guessing you had more than 3 months to plan, and now it's a fire-sale because of the procrastination? On that assumption, I am also (just guessing) it will be VERY hard for one to do a complete 180 degree shift in eating, exercise, and lifestyle...because that is what is required to lose 40 pounds in 3 months.
Eating - need to cut a significant number of calories, and you need to keep a VERY diligent log of what you are eating in order to make sure you don't falter.
exercise - you need to be burning about 1000 calories a day with exercise. This can be done by walking quickly (3.0mph) for 2 hours, or running for 1.0 hours, or jogging 1.3.
lifestyle - drinking, partying, etc. off the books for 3 months. Is this possible? No late night coffee from starbucks, no sweet, etc.
Overall, sounds pretty crappy, but totally possible. If you do all of these things, and do them "to the t", it's VERY possible to lose 40 pounds, but because you have so little time to do all of this, you don't get any mistake/ break periods.. best of luck.
-Mellon