Consider an arbitrary section of a bar lying between x and x+x. The mass in this portion of the bar can change due to three factors: flow in (through x); flow out (through x+x) and heat gain/loss throughout the section.
Balance of Mass is expressed as
where
G(x, x+x,t) is the net rate of gain of mass through the section
Mass Density
where (x',t) is the mass per unit length at section x of the bar.
Gain
Fundamental Theorem of Calculus
Balance of mass becomes
Boundary Conditions
Initial Conditions