Extra hot water for Jacuzzi
There are three subjects to consider here. 

Is your water heater working correctly. It is possible your water heater needs some maintenance as there could be too much buildup on the inside or a heating element that needs replacing. https://www.hometips.com/repair-fix/hot-water-heater-problems.html

Second the water in a water heater is usually hotter than you can use it. Then you add cold water to bring the temperature down to a usable temperature. That way a 40 gallon tank at 130 degrees should be able to produce a lot more than 40 gallons of 100 degree water. You can always turn up the temperature of the water heater. Most electric tank heaters will reach 150 or more degrees. 

The last possibility is upgrading. 
For 400 dollars US you should be able to have a small tankless point of use water heater professionally installed for just the tub. They cost less than 200 dollars for just the unit if you know how to install one. 

A full sized tankless water heater will cost you at least a thousand to install. If you get a gas tankless water heater either install in directly on an exterior wall, or get one that uses PVC venting. Metal vents that cheap systems use are wildly expensive.  

And a larger tank water heater will cost whatever you want to spend on it plus a few hundred to professionally install. I'm seeing example prices between 500 and 1500 dollars US for a 50 gallon or larger tank depending on the efficiency. Gas water heaters have a much faster recovery rate than electric. It is possible that as 40 gallon gas water heater is all you need.