# How to differentiate the Black-Scholes formula w.r.t. volatility

The Black-Scholes-Merton formula for determining call option value is given as:

$$C(S,K,\sigma,r,\tau)=N(d_1)S-N(d_2)Ke^{-rT}$$

where $N(d_i)$ is the standard normal distribution and

$$d_1=\frac{1}{\sigma \sqrt{\tau}}\ln{\frac{S}{Ke^{-rT}}}+\sigma \sqrt{\tau}$$ $$d_2=d_1-\sigma \sqrt{\tau}$$

($S$ is the current stock price, $K$ is the strike price at time $\tau$, $r$ is the risk-free interest rate. The standard deviation of the stock price is $\sigma$.)

How do you take the derivative of $C(S,K,\sigma,r,\tau)$ with respect to $\sigma$? Is it valid to do this by differentiating the Black-Scholes-Merton equation (which is different from the above formula) w.r.t. $\sigma$? The BSM equation is:

$$\frac{\partial C}{\partial t}+\frac{\sigma^2 S^2}{2}\frac{\partial^2 C}{\partial S^2}+rS\frac{\partial C}{\partial S}-rC=0$$

In which case $$\frac{\partial C}{\partial \sigma}=\frac{\sigma S^2}{r}\frac{\partial^2 C}{\partial S^2}$$ But then what is $\frac{\partial^2 C}{\partial S^2}$? I know very little about stochastic calculus.

You shouldn't start with a PDE. The Black-Scholes-Merton equation is a PDE that lists the relationship between the greeks. You will need to differentiate with the solution of the PDE . You have listed the solution to the PDE for a call option in your first part of the question. You will need to do partial differentiation for the solution. $\frac{\partial^2 C}{\partial S^2}$ is the gamma of the option.