Since you're carpooling with a person who presumably would be making the trip each day with or without you at least you aren't using any extra energy (well, a little more since the car is heavier with you in it, but not much more
) or causing any more congestion. The big drawback I see is mainly for you in this case. Commuting 40 miles each way is monumental when done by road. It can take an hour, or it can take three hours. You never know which from day to day because travel by car is highly unreliable except in rural areas, which is why I hate it. I'm the kind of person who gets pissed when the train arrives one minute late. I have no patience to deal with delays of many minutes or even hours on a regular basis. And this isn't even getting into car fumes making me sick even to go a mile or two. As long as you can deal with it, it's your choice but I think there are better ways to spend ones time than getting to work. Manhattan, which averages about 45 minutes most of the time, is about as far as I would consider commuting, and only if I was paid well. For average wages, I won't go more than about 10 minutes by bike, walking, or local bus.
P.S. I do have some experience with long commutes. For 2.5 years I commuted ~65 miles
each way to college but this was only for about 26 weeks of the year, and frequently I would arrive at 9 and leave by mid-afternoon (hardly equivalent to a regular work day). Also, my commuting was done entirely on rails with the exception of a 3 mile bus ride from my house to the subway. The breakdown was 3 miles bus (15 minutes), 10 miles subway (20 minutes), 48.5 miles commuter rail (1 hour local or 40 minutes express), 3 miles local shuttle train (5 minutes). Counting average waiting times and giving enough time to arrive before the commuter train left I usually made the trip in two hours. I made it in 1:45 when I made good connections. By car the trip was 73 miles and two hours under favorable conditions. Needless to say, I wouldn't have considered this commute practical if not for the high-speed commuter rail (the
locals made eight or nine stops yet still
averaged 50 mph thanks to fast acceleration and 100+mph top speeds). Driving, regular commuter rail, or bus would have taken far too long. Also, I wouldn't consider a two hours each way commute if I needed to work 8+ hours. It would just be too exhausting to do for any length of time.