Hi I'm trying to prove the following equality from the book "Interest Rate Derivatives Explained" given on page 176
I'm a bit baffled on how to go about this. The best idea I could come up with was if I could prove
$$\left(S-K\right)^{+} = \left(\left(S_{1}-K_{1}\right)-\left(S_{2}-K_{2}\right)\right)^{+} = \left(S_{1}-K_{1}\right)^{+}-\left(S_{2}-K_{2}\right)^{+}+\intop_{-\infty}^{A}1_{\left\{ S_{1}>x+M,S_{2}<x-M\right\} }dx+\intop_{A}^{\infty}1_{\left\{ S_{1}<x+M,S_{2}>x-M\right\} }dx$$
Then I'd be done because I could just take expectations. So the question is, is this the right approach and if so how can I prove this. Thanks

The task is to prove that
$$\underbrace{((S_1-K_1) - (S_2-K_2))^+ - (S_1-K_1)^+ + (S_2-K_2)^+}_{LHS} \\= \underbrace{\int_{-\infty}^A \mathbf{1}_{\{S_1> x+M,S_2 < x- M\}}\, dx}_{I_1}+ \underbrace{\int_A^{\infty} \mathbf{1}_{\{S_1< x+M,S_2 > x- M\}}\,dx}_{I_2}$$
For this we show that the LHS and the RHS assume the same values in each of the six cases:
$$(a)\,S_1-K_1 \geqslant S_2- K_2\geqslant 0, \quad(b)\, S_1-K_1 \geqslant 0 \geqslant S_2- K_2, \quad (c) \,0 \geqslant S_1-K_1 \geqslant S_2- K_2$$ $$(d) \, S_2-K_2 \geqslant S_1- K_1\geqslant 0, \quad (e)\, S_2-K_2 \geqslant 0 \geqslant S_1- K_1, \quad (f) \,0 \geqslant S_2-K_2 \geqslant S_1- K_1$$
The LHS, in each of these cases, reduces to
$$\begin{align}S_1-K_1 \geqslant S_2- K_2\geqslant 0&\implies LHS =0,\\ S_1-K_1 \geqslant 0 \geqslant S_2- K_2&\implies LHS = K_2 - S_2, \\ 0 \geqslant S_1-K_1 \geqslant S_2- K_2&\implies LHS = (S_1- K_1) - (S_2 - K_2), \\ S_2-K_2 \geqslant S_1- K_1\geqslant 0&\implies LHS = -(S_1-K_1) + (S_2-K_2),\\S_2-K_2 \geqslant 0 \geqslant S_1- K_1&\implies LHS=S_2 - K_2, \\ 0 \geqslant S_2-K_2 \geqslant S_1- K_1&\implies LHS = 0\end{align}$$
Turning to the integrals on the RHS, we have
$$I_1=\int_{-\infty}^A \mathbf{1}_{\{S_1> x+M,S_2 < x- M\}}\, dx= \int_{-\infty}^A \mathbf{1}_{\{S_2 +M < x < S_1- M\}}\, dx$$
If $S_1 - M \leqslant S_2 +M$, corresponding to $S_1 - K_1 \leqslant S_2 - K_2$ then we immediately see that $I_1 = 0$ since for no $x$ can it hold that $S_2+M < x < S_1-M$. We can also see by the same reasoning that $I_1 = 0$ when $S_2 +M \leqslant A$, corresponding to $S_2- K_2 \geqslant 0$.
Otherwise, if $S_1-K_1 \geqslant S_2- K_2$, then
$$I_1 = \int_{S_2+M}^{\min(A, S_1-M)}\, dx,$$
and if $S_1-M \leqslant A$, corresponding to $ 0 \geqslant S_1- K_1 \geqslant S_2-K_2$ we have (since $S_1-M > S_2 +M)$
$$I_1 = \int_{S_2+M}^{S_1-M}\, dx = S_1 -M - (S_2 +M) = S_1 - S_2 -2M = (S_1-K_1) - (S_2 - K_2)$$
If, on the other hand, we have $S_1 - M \geqslant A \geqslant S_2 +M$, corresponding to $S_1-K_1 \geqslant 0 \geqslant S_2- K_2$, then
$$I_1 = \int_{S_2+M}^A dx = A-(S_2+M) = A-M - S_2 = K_2 - S_2$$
Summarizing for each of the six cases, we have
$$\begin{align}S_1-K_1 \geqslant S_2- K_2\geqslant 0&\implies I_1 =0,\\ S_1-K_1 \geqslant 0 \geqslant S_2- K_2&\implies I_1 = K_2 - S_2, \\ 0 \geqslant S_1-K_1 \geqslant S_2- K_2&\implies I_1 = (S_1- K_1) - (S_2 - K_2), \\ S_2-K_2 \geqslant S_1- K_1\geqslant 0&\implies I_1 = 0,\\S_2-K_2 \geqslant 0 \geqslant S_1- K_1&\implies I_1=0, \\ 0 \geqslant S_2-K_2 \geqslant S_1- K_1&\implies I_1 = 0\end{align}$$
The second integral on the RHS is
$$I_2 = \int_A^{\infty} \mathbf{1}_{\{S_1< x+M,S_2 > x- M\}}\,dx = \int_A^{\infty} \mathbf{1}_{\{S_1-M< x< S_2+M \}}\,dx$$
We see immediately that $I_2= 0$ if $S_2 +M \leqslant S_1-M$, corresponding to $S_1- K_1 \geqslant S_2 - K_2$. Thus, $I_2 = 0$ in each of the first three cases (a)-(c). Continuing as before, we can show that
$$\begin{align}S_1-K_1 \geqslant S_2- K_2\geqslant 0&\implies I_2 =0,\\ S_1-K_1 \geqslant 0 \geqslant S_2- K_2&\implies I_2 = 0, \\ 0 \geqslant S_1-K_1 \geqslant S_2- K_2&\implies I_2 = 0, \\ S_2-K_2 \geqslant S_1- K_1\geqslant 0&\implies I_2 = -(S_1-K_1) + (S_2-K_2),\\S_2-K_2 \geqslant 0 \geqslant S_1- K_1&\implies I_2=S_2 - K_2, \\ 0 \geqslant S_2-K_2 \geqslant S_1- K_1&\implies I_2 = 0\end{align}$$
Combining the results we see that $LHS = I_1 + I_2 $.