Will this lens work on a Nikon d40x?
Adorama has a program where they ask people who have purchased a product to answer questions by potential buyers. They forwarded your question to me. In short, the answer is yes, this lens will work on your D40X.
That being said, I'd like to add to my wife and I own two of these lenses, and use them only for weddings just before the ceremony in close among the crowd capturing expressions and obligitory group shots. On an FX frame, this lens is ideal for this purpose, but little else. We have a couple of D-800's on order and hope they will be a more useful lens on that frame. We're currently using them on D-7000's.
For the price of this lens, you could buy a new D-3200 with an 18-55 kit lens, and take your wife out to dinner a couple times to boot. You'd get far better photos too. Normally the sage advice is to invest in great lenses, but your camera body is so far behind the times that a step up to the D-3200 would yeild far better image quality. BTW, the 18-55 kit lens shouldn't be underestimated.
On the other hand, if you want to keep the D-40x, buy the Nikon 18-200 instead of the Sigma. My wife and I use it as a primary lens more often than not, and if not, it's on our D-300's and D-90's as backup.
All the best to you,
steve and lori