Exercise 5.9 (Implying the risk-neutral distribution). Let $S(t)$ be the price of an underlying asset, which is not necessarily a geometric Brownian motion (i.e., does not necessarily have constant volatility). With $S(0)=x$, the risk-neutral pricing formula for the price at time zero of a European call on this asset, paying $(S(T)-K)^{+}$at time $T$, is
$$
c(0, T, x, K)=\tilde{\mathbb{E}}\left[e^{-r T}(S(T)-K)^{+}\right] .
$$
(Normally we consider this as a function of the current time 0 and the current stock price $x$, but in this exercise we shall also treat the expiration time $T$ and the strike price $K$ as variables, and for that reason we include them as arguments of $c$.) We denote by $\tilde{p}(0, T, x, y)$ the risk-neutral density in the $y$ variable of the distribution of $S(T)$ when $S(0)=x$. Then we may rewrite the risk-neutral pricing formula as
$$
c(0, T, x, K)=e^{-r T} \int_K^{\infty}(y-K) \tilde{p}(0, T, x, y) d y .
$$
Suppose we know the market prices for calls of all strikes (i.e., we know $c(0, T, x, K)$ for all $K>0)^2$ We can then compute $c_K(0, T, x, K)$ and $c_{K K}(0, T, x, K)$, the first and second derivatives of the option price with respect to the strike. Differentiate (5.9.3) twice with respect to $K$ to obtain the equations
$$
\begin{aligned}
c_K(0, T, x, K) & =-e^{-r T} \int_K^{\infty} \tilde{p}(0, T, x, y) d y=-e^{-r T} \tilde{\mathbb{P}}\{S(T)>K\}, \\
c_K(0, T, x, K) & =e^{-r T} \tilde{p}(0, T, x, K) .
\end{aligned}
$$
The second of these equations provides a formula for the risk-neutral distribution of $S(T)$ in terms of call prices:
$$
\tilde{p}(0, T, x, K)=e^{r T} c_{K K}(0, T, x, K) \text { for all } K>0 .
$$
${ }^2$ In practice, we do not have this many prices. We have the prices of calls at some strikes, and we can infer the prices of calls at other strikes by knowing the prices of puts and using put-call parity. We must create prices for the calls of other strikes by interpolation of the prices we do have.