Gallons in tank = x - (5 gallons per hour)*(hours)
Where x is the starting capacity of the tank, Currently, the tank has 45 gallons, so 4 hours ago:
45 gallons = x - (5 gallons per hour)*(4 hours)
45 gallons = x - 20 gallons
65 gallons = x
4 hours ago, the tank held 65 gallons of water.