If you want something other than 1080p that's as big as 40", you're looking at thousands of dollars, most likely. Are you interested in spending that kind of money?
Also, it rather depends on what you're doing with it. We have a 65" 1080p smart TV which we have hooked up to our HTPC. We sit about 8' away from it, and while 1080p video content looks astonishingly high-detail, things like fonts and web pages are a struggle to read without zooming quite a bit with Ctrl +
Sitting 3-5' from a 40" screen sounds somewhat cramped unless it's actually a computer screen. If you're using it as a computer more than you're using it for video, then you'll definitely want to consider 1440p or 4k.
As far as the smart TV is concerned, hooking up a smart TV to a HTPC is a waste of money. If you don't have an HTPC, then maybe it's a good investment.