I have my adult female in a 75g tank (48"x18") and I wouldn't go smaller. While she does often hang out on her basking spot, there are other days where she is all over her tank. My husband and I work full time, and when we are home we have other larger pets who roam the house (making it unsafe for Randal to run around solo), so Randal doesn't get a whole lot of exercise time outside of her tank which makes it particularly important that she have as much living/running space in her tank as possible. Once I have the time/money I plan on building her at least a 4'x2'x2' enclosure.
Another consideration is that most recommend at least 6-8 square feet of floor space with 18 inches width for an adult dragon and a 40g breeder gives the recommended width but only 4 1/2 feet of floor space.
If someone is home and the dragon has a time daily to roam outside of the tank, then it would probably be fine to go with the smaller alternative - otherwise the larger the tank, the more space your dragon has to exercise and the more variety you can provide for him as far as temperatures, tank furniture, etc.