This is a formula relating ∠δ,∠i,∠e and ∠r with each other. The derivation is as follows:
If we start following the incident light ray in, it gets deviated by an angle ∠θ1 = ∠i − ∠r1. If you follow the light ray where it leaves the glass, it gets bent again by an angle ∠θ2 = ∠e−∠r2, so the total deviation is:
∠δ = ∠θ1 + ∠θ2 = ∠i + ∠e − (∠r1 + ∠r2)
For the next step look at the triangle formed by the top of the prism and the light ray, and note that the internal angles must add up to 180°. So:
∠A + ∠(90−r1) + ∠(90−r2) = 180°
and a quick rearrangement gives:
∠A=∠r1+∠r2
Now substitute for r1+r2 in our first equation and we get:
∠δ = ∠i+ ∠e − ∠A
or:
∠δ + ∠A=∠i + ∠e