In the datasheet of the BQ2407x in the chapter about Thermal Consideration (par.12.3) it is reported the formula (pag.37):
P=(Vin-Vout)*Iout+(Vout-Vbat)*Ibat
but this formula is not corrected if the Functional Block Diagram (par.9.2) is the one reported at pag.14 with Q1 that shares both the output current that the charging current.
So the correct formula should be:
P=(Vin-Vout)*(Iout+Ibat)+(Vout-Vbat)*Ibat
Am I right?