Einstein’s Mass-Energy Relation:

According to Newtonian mechanics, Newton’s second law

$f=\frac{dP}{dt}$

Where $P$ is the momentum of the particle. So put $P=mv$ in above equation:

$f=\frac{d}{dt}\left ( mv \right )\quad\quad (1)$

According to theory of relativity, mass of the particle varies with velocity so above equation $(1)$ can be written as:

$f=m \frac{dv}{dt}+v\frac{dm}{dt}\quad\quad (2)$

When the particle is displaced through a distance $dx$ by the applied force $F$. Then the increase in kinetic energy $dk$ of the particle is given by

$dk= Fdx\quad\quad (3)$

Now substituting the value of force $F$ in equation $(3)$

$dk =m\frac{dv}{dt}\cdot dx+v\frac{dm}{dt}\cdot dx \quad (4) $

$dk=mv\cdot dv +v^{2}\cdot dm \:\: (5) \: \left \{ \because \frac{dx}{dt}=v \right \}$

The variation of mass with velocity equation

$m=\frac{m_{\circ}}{\sqrt{1-\frac{v^{2}}{c^{2}}}}\quad\quad (6) $

Square both sides in above equation:

$m^{2}=\frac{m_\circ^{2}}{1-\frac{v^{2}}{c^{2}}}$

$m^{2}c^{2}-m^{2}v^{2}=m_\circ ^{2}c^{2}$

Differentiate the above equation which can be written as

$2mdm\cdot c^{2}- 2m \cdot dm \cdot v^{2}-2v\cdot dv\cdot m^{2}=0$

$c^{2}dm-v^{2}dm-vm\cdot dv$

$c^{2}dm=v^{2}dm+mv\cdot dv \quad\quad (7)$

Now substitute the value of $dk$ from equation $(5)$ in equation $(7)$. So above equation can be written as:

$dk = c^{2}dm$

Now consider that the particle is at rest initially and by the application of force it acquires a velocity $v$. The mass of body increase from ${m_{\circ}}$ to $m$. The total kinetic energy acquired by the particle is given by

$dk = \int_{m_\circ}^{m}c^{2}\cdot dm$

$k = c^{2}\left ( m-m_{\circ} \right )$

$k = mc^{2} - m_\circ c^{2}$

$k+m_\circ c^{2} = mc^{2}$

Where $k$ is the kinetic energy of the particle and $m_\circ c^{2}$ is the rest mass-energy of the particle. So The sum of these energies is equal to the total energy of the particle $E$. So

Where $E$ is the total energy of the particle.