50mm, I assume you mean f/1.8? The AF-D version won't autofocus on your D40x, so wait for the new AF-S version that will autofocus on it. The 35mm f/1.8 is a great lens, but it's a more general focal length really - you'd have to get quite close for a head+shoulders portrait, it equates to a similar focal length to the human eye so imagine how close you'd have to get and you get some idea...
purely on focal length alone, 50mm.