Differentiating the risk-neutral price of a European call (Black-Scholes formula) The risk-neutral price of a European call is $$C_t = S_tN(d_1) - e^{r\tau}KN(d_2)$$ where $$d_1 = \frac{log(\frac{S_t}{K}) + (r + \frac{1}{2}\sigma^2)}{\sigma\sqrt{\tau}}$$ and $$d_2 = d_1 - \sigma \sqrt{\tau}$$
$N(x)$ is the cdf of the normal distribution. I would like to differentiate $C_t$ with respect to $S_t$, the stock price at time t, to obtain $$\frac{\delta C_t}{\delta S_t} = N(d_1)$$

I've done $C_t = S_tN(d_1) - e^{r\tau}KN(d_1 - \sigma \sqrt{\tau})$ then $\frac{\delta C_t}{\delta S_t} = S_td_1N(d_1) + N(d_1) - e^{-r\tau}Kd_1N(d_1)$
but then does $S_t = e^{-r\tau}K$ to get the required result?
K is the strike price, $r$ is the interest rate and $\tau = T - t$, where $T$ is the end of the contract.
Any help would be appreciated thanks.
 A: $\phi$ is the normal pdf, $\Phi$ is the normal cdf. We get
$$\frac{\partial C}{\partial S}=S\frac{\partial d_1}{\partial S}\phi(d_1)+\Phi(d_1)-Ke^{-r(T-t)}\frac{\partial d_2}{\partial S}\phi(d_2)$$
We notice that $\frac{\partial d_1}{\partial S}=\frac{\partial d_2}{\partial S}$ (follows from the definition) so
$$\frac{\partial C}{\partial S}=\Phi(d_1)+\frac{\partial d_1}{\partial S}\bigg(S\phi(d_1)-Ke^{-r(T-t)}\phi(d_2)\bigg)$$
It suffices to show that the term in the parenthesis is $0$. We get
$$\begin{aligned}
S\phi(d_1)&=\frac{1}{\sqrt{2\pi}}\exp\bigg(\ln(S)+\frac{-(\ln(S/K)+(r+\sigma^2/2)(T-t))^2}{2\sigma^2(T-t)}\bigg)=\\
&=\frac{1}{\sqrt{2\pi}}\exp\bigg(\ln(S)+\frac{-(\ln(S/K)+(r-\sigma^2/2)(T-t)+\sigma^2(T-t))^2}{2\sigma^2(T-t)}\bigg)=\\
&=\frac{1}{\sqrt{2\pi}}\exp\bigg(\ln(S)-\frac{(\ln(S/K)+(r-\sigma^2/2)(T-t))^2}{2\sigma^2(T-t)}-\frac{\sigma^2(T-t)}{2}+\\
&-(\ln(S/K)+(r-\sigma^2/2)(T-t))\bigg)=\\
&=\frac{1}{\sqrt{2\pi}}\exp\bigg(\ln(K)-r(T-t)-\frac{(\ln(S/K)+(r-\sigma^2/2)(T-t))^2}{2\sigma^2(T-t)}\bigg)=\\
&=Ke^{-r(T-t)}\phi(d_2)
\end{aligned}$$
