Energy shift between hydrogen and deuterium

Stated: The atomic spectra of hydrogen and deuterium are similar however shifted in energies.

So im trying to explain why it is that the emission lines are shifted and how they are shifted.

Since the nucleus of deuterium contains both a proton and a neutron its notably heavier than the nuclueus of hydrogen, which only contains a proton. And since the transition energy is given by following equation: $E_i-E_f = \frac{\mu_xZ^2e^4}{(4\pi\varepsilon_0)^22h^2}\left[\frac {1}{n_f^2}-\frac {1}{n_i^2}\right]$, where $\mu_x$ is the reduced mass of Atom $X$. its clear that the energy varies with the atom mass.

But i dont really know how to tackle the second part of my problem i.e. explaining how they are shifted.

-

Consider the ratio of their shifts in energy. Since all the numbers are the same except for the reduced mass you are looking at something like: $$\frac{(E_i -E_f)_p}{(E_i -E_f)_d}=\frac{\mu_p}{\mu_d}=\frac{m_p m_e(m_d +m_e)}{(m_p +m_e)m_d m_e}$$ If we cancel the $m_e$ and then pull a $m_d$ out of the top and a $m_p$ out of the bottom we get $$\frac{(E_i -E_f)_p}{(E_i -E_f)_d}=\frac{(1+\frac{m_e}{m_d})}{(1+\frac{m_e}{m_p})}$$ I hope this helps.
They have different reduced masses. Because the mass the proton is about 1800 times that of the electron, it's typical to approximate the reduced mass of the hydrogen atom as the mass of the electron. If you use the exact formula for the reduced mass instead of that approximation, you should get that the reduced mass of hydrogen is $\mu_H = 0.99946m_e$, and that the reduced mass of deuterium is $\mu_D = 0.99973m_e$. The ratio of the transitions is then the ratio of those reduced masses, as @knjves explains. That is a very small difference, but it is measurable.