A 40 gallon isn't the best idea. If you are getting a hatchling a 10 - 20 gallon would be far more appropriate. Even for adults I wouldn't suggest a 40 gallon. They are impossible to maintain heat and humidity in.
If the room that you are going to keep the snake in stays around 75 then I would suggest a tub. If it gets colder than that a 10 or 20 gallon tank with an infrared heat lamp will be better.
If you go the tub route you will need a tub, a heating pad, a thermostat, 1or 2 hides, a water dish, and a probed thermometer.
Heating pad: http://m.petsmart.com/mt/www.petsmar...ductId=2752652
Thermostat (3 options depending on budget. Stay away from the junk sold in pet stores):
Budget: http://www.amazon.com/gp/aw/d/B000NZZG3S
Mid-Range: http://www.reptilebasics.com/ranco-etc-111000-pre-wired
Best: http://spyderrobotics.com/home/products.html
Hides: http://www.reptilebasics.com/hide-boxes
Water dish: http://www.reptilebasics.com/small-water-bowl
Probed thermometer: you can get this thermometer/hygrometer from Walmart for $12. It measures 2 temperatures and humidity. (The probe will go on the floor of the tub directly over the UTH, and the unit will sit on the cool side)
If you go the tank route you will need a 10-20 gallon tank, a screen top, clips for the screen top, a heat lamp fixture, an infrared heat bulb, a probed thermometer, 2 hides, a water dish, and a humidity retaining substrate.
Heat lamp fixture: http://m.petsmart.com/mt/www.petsmar...ductId=3569157
Infrared heat bulb: http://m.petsmart.com/mt/www.petsmar...uctId=11147193