A boiler assisted tank can heat a lot more water than an electric. The recovery rate is higher as well, so a 40-gallon electric may not (likely won't) fill the tub. Once hot, it doesn't take all that much to keep it hot in an electric tank. A Kw=3412BTU. One BTU can raise one pound of water one degree. So, depending on how cold the water coming in is, and how hot you make it, and how much you use, you can figure it out. A gallon of water weighs about 8# (less, but that would give you some room for standby losses).
So, to raise 40-gallons of water from say 40-degrees to 120-degrees (about the minimum you want) means:
40*8 or 320# of water, *80 degrees, or 25600BTU /3412 = about 7.5Kwhr.
Then, add in any other hot uses during the day, and you can figure out approximately how much energy it will take; then, multiply by the local rates. Sometimes, it is a tiered rate, and the more you use, the higher the cost/Kw, so it might bump you up to a higher rate.