I was looking at a physics situation involving light, and I can make the correct derivation assuming light is a ray of a given intensity (geometric optics), energy conservation checks out, everything. But when I try to move to a wave model of light to take into account interference, nothing works out anymore - I get completely different results. And I don't know why. It's driving me insane.
Here is the situation. Find the total reflected and transmitted light intensity from/across this layer.
External medium has refractive index $n_0$, layer $n_1$ and internal medium $n_2$. Using Fresnel equations, call the reflectance of interface $n_i \to n_j$, $\text{R}(n_i \to n_j)$ and call the transmittance $\text{T}(n_i \to n_j)$.
The Fresnel properties apply, $\text{R}(n_i \to n_j) = \text{R}(n_j \to n_i)$, $\text{T}(n_i \to n_j) = \text{T}(n_j \to n_i)$, and:
$$\text{R}(n_i \to n_j) + \text{T}(n_i \to n_j) = 1$$
I'll just do the transmitted light derivation since its enough to show my problem. The transmitted light is:
$$\text{T} = \text{T}(n_0 \to n_1) \cdot \text{T}(n_1 \to n_2) \cdot \sum \left (\text{R}(n_1 \to n_0) \cdot \text{R}(n_1 \to n_2) \right )^k$$
$$\text{T} = \frac{\text{T}(n_0 \to n_1) \cdot \text{T}(n_1 \to n_2)}{1 - \text{R}(n_1 \to n_0) \cdot \text{R}(n_1 \to n_2)}$$
A similar derivation gets the reflected intensity, and they correctly add up to 1, as expected.
Now assume light is a wave, the layer has thickness $\delta$ and the incident wave (in red) has wavelength $\lambda$.
Now use the Fresnel equations for amplitudes, call them $\text{r}(n_i \to n_j)$ and $\text{t}(n_i \to n_j)$.
The phase shift for the $k$th transmitted wave is (assume no phase shift due to reflection):
$$\frac{2 k \pi}{\lambda} \left ( 2 n_1 \delta \cos{\theta} \right ) = k \varphi$$
Where $\theta$ is the angle made by the light wave inside the layer (depends on incident angle).
Then, the transmitted intensity is:
$$\text{T} = \left | \text{t}(n_0 \to n_1) \cdot \text{t}(n_1 \to n_2) \cdot \sum \left (\text{r}(n_1 \to n_0) \cdot \text{r}(n_1 \to n_2) \cdot e^{i \varphi} \right )^k \right |^2$$
$$\text{T} = \frac{| \text{t}(n_0 \to n_1) |^2 \cdot | \text{t}(n_1 \to n_2) |^2}{| \text{r}(n_1 \to n_0) |^2 \cdot | \text{r}(n_1 \to n_2) |^2 - 2 \cdot \text{r}(n_1 \to n_0) \cdot \text{r}(n_1 \to n_2) \cdot \cos(\varphi) + 1}$$
Which isn't even close to the right result! This is completely meaningless.
I understand this isn't an elegant way to do electromagnetics and it makes a lot of assumptions (I am not a physics student, this is for computer graphics) but I don't understand why the two models don't give the same answer? I know I'm making a mistake in the second one but I can't find it. I thought this is how you add waves and I feel my sum is correct but the results still don't agree with the geometric optics result. Note I removed the $\omega t$ part from the wave since it cancels out in the end.
I guess an equivalent question would be, could someone show me the correct wave optics derivation (which should average out to the geometric optics solution over all possible phase shifts, as noted in comments)? Because I've spent days on this problem and I'm really at my wit's end at this point.
EDIT: after putting Mathematica to work on this, it turns out the wave optics average is equal to the geometric optics solution, with one small issue: it's telling me that $|\text{t}|^2$ is equal to the transmittance $\text{T}$, which is apparently wrong according to the Wikipedia Fresnel article, where:
$$\text{T}(n_i \to n_j) = \frac{n_j \cos{\theta_j}}{n_i \cos{\theta_i}} |\text{t}(n_i \to n_j)|^2$$
But at least it looks as if I wasn't completely all wrong. So now I just need help on understanding why the transmittance coefficient doesn't work out as it should..