Something has always bothered me about the way the de Broglie relation is derived and I've never seen anyone address this, so I'm hoping someone here can. As I understand it, the derivation begins with two of Einstein's equations: E=hf, and E=pc. E=hf was experimentally obtained by Einstein. E=pc is derived from special relativity, and is the special case of the more general E^2-(pc)^2=(mc^2)^2, when m=0. In other words E=pc is exactly true for a massless particle but not true for massive particles. From E=pc and E=hf, we get pc=hc/lambda, and lambda=h/p. This is the de Broglie wavelength. This is clearly correct for photons, but then de Broglie took it a step further and used p=ymv to get lambda=h/(ymv). However, p=ymv is true only for massive particles, yet earlier we used E=pc, which is true only for massless particles. Isn't this a logical flaw in the derivaiton? If so, is the fact that it nonetheless leads to the right result sufficient to explain it?