In many places I have come across the following derivation
Work done in isothermal expansion
By first law of thermodynamics
As $\mathrm dU=nC_V\,\mathrm dT$, and in isothermal process $\mathrm dT = 0$
i.e heat absorbed is completely converted into work
The second step doesn't make any sense at all. As far as my understanding $\mathrm dU=nC_V\,\mathrm dT$ is true only when volume is constant, but it's clearly mentioned expansion in the statement.
So how to justify the use of $\mathrm dU=nC_V\,\mathrm dT$ expression even when volume is not constant?
Please consider the fact that I'm a school student so please answer in a simple manner.