We evaluate and compare the gravitational wave and density perturbation contributions to the cosmic microwave background radiation on the basis of the same power-law inflationary model. The inflation to radiation transition is treated in this paper as instantaneous, but a model is constructed to allow for a smooth transition from the radiation- to the matter-dominated eras. The equations are numerically investigated and integrated, without any basic approximations being made. Use is made of the synchronous gauge, with appropriate gauge-invariant variables, thus eliminating any confusion arising from unphysical gauge modes. We find a non-negligible gravitational wave contribution, which becomes dominant for a power-law expansion with exponent $q<13$. We also explore the dependence of our results with the main characteristic of the transition region, its length.