Using snell's law, we know that at the first refraction we have:

**1*sinθ1 = n*sinθ2**

The critical angle at the second surface is given by:

**n * sinθ3 = 1, **so

**θ3 = inverse sin( 1 / n )**

Using the geometry of the triangle, we can conclude that:

**(90° − θ2) + Φ + (90° − θ3) = 180°,**

so

**θ2 = Φ − θ3.**

So to have

**θ3 = inverse sin( 1 / n )** and to avoid total internal relection at the second surface, it is necessary that:

**θ2 = ****Φ −** **inverse sin( 1 / n )**

plugging back in the first relation we get that:

**sinθ1 = n*sin(****Φ −** **inverse sin( 1 / n )****)**

and so

**θ1 = inverse sin (n*sin(Φ − inverse sin( 1 / n )) )**

simplifying using trig identites we get that: