I was asked to show that the price of a digital/binary option $D$ while a volatility smile $\sigma(K)$ is present is given by
$$D= \exp(-rT)( \Phi(d_2) - K \sqrt{T} \phi(d_2) \sigma ' (K))$$
Where $\Phi$ is the standard normal CDF and $\phi$ is the standard normal pdf. I started with showing that the price of $D$ under B-S is given by $-\frac{\partial C}{\partial K}$, where $C$ is the standard B-S pricing for a call option. Additionally, I have also shown that this can also be expressed as (with no vol smile) $$-\frac{\partial C}{\partial K} = \Phi(d_2)$$
Finally, I was able to show the following $$D = -\frac{\partial C}{\partial K} - \frac{\partial C}{\partial \sigma} \frac{\partial \sigma}{\partial K}$$
Now, the $\frac{\partial C}{\partial \sigma}$ term is Vega, which is explicitly given by $$\frac{\partial C}{\partial \sigma} = S\phi(d_1)\sqrt{T}$$
And now I have absolutely no idea what to do, because the question involves a $K\phi(d_2)$ term, but I have an $S\phi(d1)$ term. Are they related somehow?