I have to show that:
\begin{equation} P_{t,T}(K)=e^{-r(T-t)} \int_0^{\infty}\left(K-S\right)^+ q_T^S(S)dS \end{equation}
is equivalent to: \begin{equation} P_{t,T}(K)=e^{-r(T-t)}\int_{-\infty}^{K}\left(\int_{-\infty}^y q_T^S(z)dz\right)dy \end{equation}
Breeden and Litzenberger have shown that using Leibniz integration rule and differentiating the first equation twice leads to: \begin{equation} q_T^S(K)=e^{rf(T-t)}\frac{\partial^2P_{t,T}(K)}{\partial K^2}\vert_{K=S_T} \end{equation}
However, I have difficulties to directly go from the first to the second equation in an elegant way. Does anyone have an idea how this can be achieved?
Many thanks for the help!