All plants and animals, living and dead contain carbon. C12 is stable while its isotope C14 is radioactive which decays to C12. This C14 isotope is formed by cosmic rays which are assumed to have hit the earth at a relatively constant rate. These cosmic rays react with nitrogen present in atmosphere and form this C14 isotope. ${}_7N^{14}+{}_0n^1 \to {}_6C^{14}+{}_1H^1$
Let the number of atoms of 6C14 in a body initially be N0 when it meets its death at t=0. After time t of its death, let the body contains the number of atoms of 6C14 and 6C12 equal to N14 and N12 respectively. Then, $N_0=N_{12}+N_{14} \text{ __(1)}$ According to radioactive decay, $N_{14}=N_0e^{-λt} \text{ __(2)}$ From equations (1) and (2), $N_{14}=\left( N_{12}+N_{14} \right)e^{-λt}$ $e^{λt}=\frac{N_{12}}{N_{14}}+1$ Taking ln, $lne^{λt}=ln\left(\frac{N_{12}}{N_{14}}+1\right)$ $λt=ln\left(\frac{N_{12}}{N_{14}}+1\right)$ $t=\frac{1}{λ} ln\left(\frac{N_{12}}{N_{14}}+1\right)$ Where, $λ=\frac{ln(2)}{T_{1/2}}$ And, T1/2 of carbon is 5730 years.