The first equation of thermodynamics states that the change in internal energy of a system is equal to the heat added to the system minus the work done by the system on the environment, thus we can use this formula to calculate the work done on the environment by the gas as the balloon expands:
ΔU = Q - W
where:
U = Alteration in internal energy
Q is the heat added to the system, and W is the work the system does on the environment.
What we have here is
ΔU = 6391 J Q = 47014 J
Consequently, we may rewrite the equation to account for W:
W = 47014 J - 6391 J, where W = Q - U
W = 40623 J
Consequently, the amount of environmental damage caused by the gas as the balloon grows is 40623