How did we get the formula $d U = nCvdT$? Our teacher taught us that for any thermodynamic process, dU=nCvdT where Cv is molar specific heat capacity at constant volume and dU is change in internal energy. How did we get this formula and why is it valid for all processes
 A: The general relation for all materials is $$dU=C_V\,dT+(\alpha TK-P)\,dV,$$
with internal energy $U$, constant-volume heat capacity $C_V\equiv T\left(\frac{\partial S}{\partial T}\right)_V$, temperature $T$, constant-pressure thermal expansion coefficient $\alpha\equiv\frac{1}{V}\left(\frac{\partial V}{\partial T}\right)_P$, constant-temperature bulk modulus $K\equiv-V\left(\frac{\partial P}{\partial V}\right)_T$, pressure $P$, and volume $V$. We derive this from expanding $U$ in its natural variables $T$ and $V$:
$$dU=\left(\frac{\partial U}{\partial T}\right)_V dT+\left(\frac{\partial U}{\partial V}\right)_T dV,$$
with the rest being just application of the identities above along with the fundamental relation $dU=T\,dS-P\,dV$ for a closed system. (Note that $\left(\frac{\partial S}{\partial V}\right)_T=\left(\frac{\partial P}{\partial T}\right)_V=-\left(\frac{\partial V}{\partial T}\right)_P\left(\frac{\partial P}{\partial V}\right)_T$ via a Maxwell relation and the triple product rule.)
So $dU=C_V\,dT$ clearly holds for constant-volume processes ($dV=0$). Interestingly, it also always holds for the ideal gas, whose equation of state $PV=nRT$ causes $\alpha TK-P$ to be identically zero (as $\alpha =\frac{1}{T}$ and $K=P$). That is, even if $dV\neq 0$, its coefficient is zero. This has frustrated endless numbers of new thermodynamics practitioners because the resulting equation (which contains a material property with "constant-volume" in its name) applies to all processes, and in general—but only for the ideal gas. It's as if the equation is too simple for its own good. Much more discussion.
A: $dU=nC_{v}dT$ is only valid for all processes in the case of an ideal gas where the internal energy is considered to be purely kinetic depending on temperature only. We get this formula for ideal gases by combining the first law, the ideal gas law. and the general definition of the molar specific heat at constant volume.
You can find a derivation here:How can internal energy be $\Delta{U} = nC_{v}\Delta{T}$?
Hope this helps.
A: It is not valid for all process. In case of single uniform system, it is valid for constant volume processes. It is also always valid in case of ideal gases (even for processes which change volume).
Heat capacity at constant volume is the amount of heat that needs to be added to the system to increase its temperature by unit degree. Mathematically,
$$
C_V(T) = \lim_{V=const., \Delta T\to 0} \frac{\Delta Q}{\Delta T}.
$$
or
$$
C_V(T) = \frac{dQ}{dT}.
$$
Specific heat capacity $c_V$ is heat capacity per one mole, so we have
$$
C_V = n c_V,
$$
where $n$ is number of moles in the system.
If volume is kept constant, internal energy $U$ cannot change by accepting mechanical work, so it only can change via adding heat, so we have $\Delta U = \Delta Q$.
Combining all these facts, we get
$$
dU = C_V dT = nc_vdT.
$$
A: Your teacher must have taught you this common definition for specific heat capacity - Amount of heat required to raise the temperature of one gram of substance by one degree Celsius. expressed as $Q = m c \Delta t$, rearranging this you will get expression for $c$ - specific heat capacity. For very smaller changes it will be expressed in terms of differential $Q = m c dt$.
Similarly we can understand the expression for internal energy. But first we should know about First law of Thermodynamics (TD) which is about conservation of energy. Simply put you are just keeping track of the transformation of energy that is supplied/removed in the form of heat or work and the energy present in a thermodynamic system.
System refers to susbstance that is present inside the boundary generally gas or fluid will be considered and other contents like if any shaft or other work involved. Outside the boundary it is called surroundings and we will not deal with changes in surroundings here in first law.
Expressed as $Q = W + \Delta E$
$Q$ - Heat Transfer,
$W$ - Work Transfer/Work done,
$E$ - Total Energy of the system
$\Delta E = \Delta$ Kinetic Energy $+ \Delta$ Potential Energy $+ \Delta$ Internal Energy
When we are doing analysis of first law we will assume simple case which is a simple compressible stationary system i.e. system is only gas and which is  filled in a piston cylinder arrangement and it is not moving and hence changes in Kinetic Energy (K.E) & Potential Energy (P.E) will be zero, thus only internal energy of the system is considered.
So, Internal energy deals with changes in energy in microscopic level like molecular kinetic energy, intermolecular forces of attraction etc... Don't confuse molecular kinetic energy with the kinetic energy of the system. K.E system represents the whole K.E of the gas (system) as a bulk. Imagine a closed container or piston cylinder arrangement filled with gas is in motion then in this case changes in K.E and P.E of the gas system as a whole should be considered in $\Delta E$. Since we are assuming stationary system, the gas filled container is not moving and hence we can put zero for $\Delta$K.E & $\Delta$P.E in total energy change that is $\Delta$E.
So we can write first law as
$Q = W + $\Delta U$
For infinitesimal change we can rewrite in differential form for first law as
$\delta Q = \delta W + dU$
Assuming that you are familiar with the concept of kinetic theory of gases and ideal gas. so I am not explaining fully here. From kinetic theory of gases for ideal gas change in internal energy is function of temperature only, $U = f \left( T \right)$.
Now, Consider ideal gas filled in a piston cylinder arrangement and you are supplying small amount of heat $\delta Q$, now because of this heat supplied the gas (system) expands and it does small work $\delta w$ by moving the piston outwards for a small distance. Here $\delta Q$ heat supplied is not completely converted to work $\delta W$ but some amount of heat goes in as changing the internal energy $dU$ of the gas because of change in temperature. Thus, $\delta Q = \delta W + du$.
Consider the same piston cylinder arrangement filled with ideal gas but this time piston is locked at its ends. So piston cannot move. Repeat the same heat supply procedure as above. Since piston cannot move, $\delta W$ becomes zero because the volume of the gas is not changing. Thus it becomes a constant volume process. Now whatever heat added will completely go in as changing the internal energy of the gas Thus , %\delta Q = du$.
So we can rewrite above expression in terms of heat transfer as
$m c dt = du$
because change in internal energy is happening at constant volume process for ideal gas we can replace specific heat capacity $c$ with specific heat capacity at constant volume $c_{v}$.
Thus $du = m c_{v} dt$
It is valid for all processes only if its an ideal perfect gas, because specific heat capacity at constant volume $c_{v}$ doesn't change with temperature in any processes for perfect gas.
It is also valid for any gas or substance undergoing only constant volume process.
For real gas Internal energy $U$ is function of both temperature and specific volume, thus for internal energy we can write $U = f \left( T , v \right)$ and which will be expressed in total differential as mentioned in the previous answers.
Note: $Q$ (Heat) and $W$ (Work) are path functions and inexact differential thus we cannot represent as $\Delta Q$ or $\Delta W$. In differential it is represented with $\delta Q$ or $\delta W$.
A: Starting from scratch, we know that amount of heat $Q$ supplied to an object, its temperature $T$ raises, $Q\propto \Delta T$. But change in temperature is different for different materials known as specific heat $c$, and also depends upon amount of matter contained by the object, so $Q=mc\Delta T$.
This heat supplied to an object is further divided into two parts for better analysis and applicability for using as work done either as medium or mix with medium as fuel. So amount of heat is classified as imparting kinetic energy known as internal energy $U$ and potential energy as enthalpy $H$.
Internal energy depends upon pressure of gas and to know exact amount of work can be obtained from it, we keep volume to constant so know about specific heat $c_V$. Therefore, $Q=\Delta U=mc_V\Delta T$. Similarly amount of heat absorbed for chemical reaction of substance is enthalpy and measured at keeping constant pressure to know amount of heat from reaction or combustion, thus $Q=\Delta H=mc_p\Delta T$.
