I've got to admit, I have always been vehemenetly against the tang police and the gotta have 100g to be in the club mentality, but a tang in a 40g I wouldn't do it...
I have a YT in my 65 (or 60g I dont know what size it is) and it is awesome. but it does swim around a lot and its the undisputed master of the tank. It never messes with the maroon clown though. I would say a 4ft tank is a must for the YT (IMO---you can put one in a 5g if you so choose). a 55g would be the minimum. (I can't believe that I am saying that!!!!) its just that after seeing how well the YT does in my 4ft 65g I couldn't see it in a shorter tank....
length of the tank is the most important, width and height are forgiving IMO...
good luck