if all you have is a 40 gallon tank and don't want to buy a second tank I would recommend getting a piece of plexiglass or a sheet of plastic and using aquarium grade silicone to hold it in place as a divider.