Unfortunately no. Balas reach 12-14" and need a lot of open space to swim. They scare easily and will bash themselves into the sides of your tank. They're beautiful fish, but they need a school (six or more) to feel comfortable. People buy these with the intention of upgrading the tank "later" but unfortunately never do, resulting in stunting and premature death. Balas can easily live 15+ years, but need a tank of at least 300 gal. or more. I hate that they're so easily purchased at any LFS because they're truly beautiful fish, and it's easy to see why people would want them. They're just not a good fish for your average home aquarist. Petsmart actually suggests a 30 gal. for them. Good lord.
But! You have a 40 gal...is this a long tank or tall? You have quite a few options for a tank that size, especially if it's long. If you like sharks, and just want one, how about the red-tailed shark? They're not schoolers, so you can have just one. They can get a bit aggressive if not given lots of caves and cover, so if you've got a densely planted tank with some driftwood, that would be great for them. They make a nice centerpiece fish and can also be housed with schools of same sized or smaller fish without incident IF, again, they have enough cover. They're "nervously aggressive" fish that need to be able to get away when scared or they'll attack, but they're a nice "sharky looking" fish.
But! You have a 40 gal...is this a long tank or tall? You have quite a few options for a tank that size, especially if it's long. If you like sharks, and just want one, how about the red-tailed shark? They're not schoolers, so you can have just one. They can get a bit aggressive if not given lots of caves and cover, so if you've got a densely planted tank with some driftwood, that would be great for them. They make a nice centerpiece fish and can also be housed with schools of same sized or smaller fish without incident IF, again, they have enough cover. They're "nervously aggressive" fish that need to be able to get away when scared or they'll attack, but they're a nice "sharky looking" fish.