An ideal gas expanding at constant temperature and quasi-statically (slowly enough to allow the system to fairly stay in thermodynamic equilibrium at all times) would be seen as a hyperbola on a Pressure-Volume diagram with equation PV = Constant.
The work done by the gas equals the change in internal energy of the gas.
Isothermal or "same-heat" expansion of the gas occurs when the gas is placed in positive thermal contact with a heat reservoir at the same temperature.
W = ∫(from V-initial to V-final)PdV gives the work done by the gas; for an ideal gas and a quasi-static process, PV = nRT is applied for each point on the hyperbola.
Then W = ∫(from V-initial to V-final)PdV or W = ∫(from V-initial to V-final)nRTdV/V; here nRT is constant so one can write W = nRT∫(from V-initial to V-final)dV/V or [nRT ln V|(from V-initial to V-final)].
Placing given values, the work or internal energy of the gas is then written as (3.1 moles)(8.3145107 Joules per "Mole-Dot-Kelvin")(290 Kelvin) ln (1.5Vinitial/Vinitial) or 7474.745119 ln (1.5) which yields 3030.748338 Joules; this is equivalent to 3000 Joules and is positive energy or work since the gas is expanding rather than compressing.