D40 is excellent... ( I love mine!)
-D60 is an update of the D40 with more MPs, but other stuff left out and a slower flash sync speed.
The D50 is an update of the D70/D70s, and as such is a bit obsolete. But it does have an advantage in that it can autofocus with ALL of the Nikkor AF lenses, while the D40+60 can only do so with AF-S and AF-I lenses...
Check out Ken Rockwell/s site about Nikon DSLRs and lenses. I believe he picks the D40 over all the ones you mentioned, plus over the D40X also...