How long will this appliance run from a battery?
Short answer: 9 hours, 36 minutes
Assuming the system is 100% efficient, (i.e. no resistive losses in cables, or internal resistance from battery)
Power (Watts) = I(Amps) * V(Voltage) Therefore, Amps = Power/Voltage 50/12 = 4.16666A
Assuming that the battery is fully charged, then it will have the full 40AH capacity.
This battery is not linked to a boost converter or anything like that, so it would be 4.16 amps at 12 volts, so we don't need to do any more calculating here. If the power output was not at 12v, then we would reverse the power equation to do 12*40 = 480WH. This means the battery can provide 480 Watts for 1 hour.
40AH (Amp Hours)/4.16Amps = 9.6 hours, or 9 hours and 36 minutes. or 480WH (Watt Hours)/50 (Watts) = 9.6 hours, or 9 hours and 36 minutes.
Sadly, in the real world, nothing is as easy as this. Batteries are not perfect. They have some internal resistance, which we have to factor in.
We can also calculate the resistive losses from the internal resistance of the battery from the 400A rating
R = V/I R = 12/400 R = 0.03 ohms P = I^2 * R P = 4.16^2 * 0.03 = 0.52083W lost
In 1 hour = 0.52083Wh lost, as you multiply by one. Therefore, in 9.6 hours, it means 5 watts is lost.
480Wh - 0.52083Wh = 479.49716 Wh 479.49716/50 = 9.589583 hours. This is 9 hours, 35 minutes and 22.5 seconds
Practically speaking, about 4 - 5 hours. Your battery energy capacity is 12 volts x 40 amp-hours, for a total of 480 watt-hours. Divide this by 50 watts, and you get 9.6 hours.
BUT. This is a car battery, not a deep-discharge marine battery. If you discharge it by more than 50%, you will shorten its life. If you drain it completely you will shorten its life a lot.
So, assuming you want the battery to last, don't discharge it more than about 50%, which will take about 5 hours. Limiting run time to 4 hours will do even better.
First figure out how many amps your device consumes, in this case ~4.16 (50W/12V). Amps = Power/Voltage.
Then divide your amp hours by the amps, 40Ah/4.16A gives you ~9.6Hours. This doesn't take into account specific battery chemistry, temperature, etc.