Can someone confirm whether the following derivative is correct?
I want to find the derivative with respect to S of:
$S*\exp((b-r)*T) * N(x_1) $ where $x_1 = \frac{\ln(S/X)}{\sigma \sqrt(T)} + (1+\mu)\sigma\sqrt(T)$
What I found:
$\frac{\partial}{\partial S} S*\exp((b-r)*T) * N(x_1) = \frac{\partial}{\partial S} S*\exp((b-r)*T) * \frac{1}{\sqrt(2 \pi)} * \exp(-\frac{x^2}{2})$
Plugging in $x_1 = \frac{\ln(S/X)}{\sigma \sqrt(T)} + (1+\mu)\sigma\sqrt(T)$ yields
$\frac{\partial}{\partial S} S*\exp((b-r)*T) * \frac{1}{\sqrt(2 \pi)} * \exp(-\frac{(\frac{\ln(S/X)}{\sigma \sqrt(T)} + (1+\mu)\sigma\sqrt(T))^2}{2})$
Now, using the productrule where
$f(S) =S*\exp((b-r)*T) * \frac{1}{\sqrt(2 \pi)}$
and
$g(S) = \exp(-\frac{(\frac{\ln(S/X)}{\sigma \sqrt(T)} + (1+\mu)\sigma\sqrt(T))^2}{2}) $
we can find the derivative by $f'(S)g(S)+f(S)g'(S)$.
$f'(S) = \exp((b-r)*T) * \frac{1}{\sqrt(2 \pi)}$
$g'(S) = \exp(-\frac{(\frac{\ln(S/X)}{\sigma \sqrt(T)} + (1+\mu)\sigma\sqrt(T))^2}{2}) * \frac{1}{S\sigma \sqrt(T)} $ (where I used the chainrule)
Thus, $\frac{\partial}{\partial S} = f'(S)g(S)+f(S)g'(S) = \exp((b-r)*T) * \frac{1}{\sqrt(2 \pi)} * \exp(-\frac{(\frac{\ln(S/X)}{\sigma \sqrt(T)} + (1+\mu)\sigma\sqrt(T))^2}{2}) \\ + S*\exp((b-r)*T) * \frac{1}{\sqrt(2 \pi)} * \exp(-\frac{(\frac{\ln(S/X)}{\sigma \sqrt(T)} + (1+\mu)\sigma\sqrt(T))^2}{2}) * \frac{1}{S\sigma \sqrt(T)} $
Apply the good old product rule to $$ \underbrace{Se^{(b-r)T}}_{f(S)}\,\underbrace{N(x_1)}_{g(S)}\quad\text{ where }x_1=\frac{\ln(S/X)}{\sigma\sqrt{T}}+(1+\mu)\sigma\sqrt{T}\, $$ and $N(x)$ is the CDF of the standard normal distribution. The derivative of $g$ w.r.t. $S$ will include the applcation of the chain rule to $N(x_1)$: \begin{align} &\frac{\partial}{\partial S}\Big\{Se^{(b-r)T}\,N(x_1)\Big\}=\underbrace{e^{(b-r)T}\color{red}{N(x_1)}}_{f'(S)\,g(S)}+\underbrace{Se^{(b-r)T}\,N'(x_1)\frac{\partial x_1}{\partial S}}_{f(S)\,g'(S)}\\ &=e^{(b-r)T}\color{red}{N(x_1)}+Se^{(b-r)T}\frac{1}{\sqrt{2\pi}}\exp\Bigg(-\frac{(\ln(S/X)+(1+\mu)\sigma^2T)^2}{2\sigma^2T}\Bigg)\frac{1}{S\sigma\sqrt{T}}\,. \end{align}