Why do electromagnetic waves have the magnetic and electric field intensities in the same phase? My question is: in electromagnetic waves, if we consider the electric field as a sine function, the magnetic field will be also a sine function, but I am confused why that is this way.
If I look at Maxwell's equation, the changing magnetic field generates the electric field and the changing electric field generates the magnetic field, so according to my opinion if the accelerating electron generates a sine electric field change, then its magnetic field should be a cosine function because $\frac{d(\sin x)}{dx}=\cos x$.
 A: E and B are in phase for a running plane wave, but are 90 degrees out of phase for a standing wave. This can be easily seen by considering the vector potential, $A(t, x) $. Using $E = \partial_t A$ and $B=\partial_x A$. For $A=sin(\omega t - kx) $ you find that E and B are in phase. For $A=sin(\omega t) sin(kx) $, a standing wave, E and B are out of phase. 
A: The Maxwell equations that relate electric and magnetic fields to each other read (in vacuum, in SI units) as
\begin{align}
\nabla \times \mathbf E & = -\frac{\partial\mathbf B}{\partial t} \\
\nabla \times \mathbf B & = \frac{1}{c^2} \frac{\partial\mathbf E}{\partial t},
\end{align}
where the notation $\nabla \times{\cdot}$ is a spatial derivative (the curl). This means that both sides have derivatives, and if you're applying them to a function like $\cos(kx-\omega t)$, then they will both change the cosine into a sine. This is what locks the phase of both waves to equal values.
A: This is one of those 'why' questions that physics can or cannot answer, depending on what you want from answer to 'why'.
If equations are a satisfactory explanation, then the Maxwells Equation in Emilios answer are a complete answer.
Unfortunately, not far beneath the surface of that answer is 'why do Maxwells Equations' fit reality?' or 'why do fields behave the way they do so that we can derive Maxwells Equations?'. Wigner along with many other physicists was similarly troubled by such questions.
It doesn't get any more intuitive if you go down further to QED to try to explain the classical behaviour.
At the lowest level, the answer is 'that's the way Nature behaves'. 
A: The E and H fields in a time-harmonic EM wave are in phase in the time domain when the medium's polarization (electric and magnetic) are in phase with the corresponding fields. You can see that polarization fields inherently act as 'source' terms in Maxwell's equations, and hence, instantaneous polarization implies in-phase relationship. However, whenever there is dissipation (such as existence of conduction current, or out of phase polarization), the E and H fields are no longer in phase. In other words, the one phasor cannot respond instantaneously to the changes of the second one in time. Note that regardless of propagating or standing wave, E and H fields are in phase with each other in the time domain in a lossless medium (for a standing wave, they are 'out of phase' spatially). 
A: Your question is right. When many students ask this question, the professor can only mutter about it. Anyway, it is the result of Maxwell's equation. Electric field and magnetic field have the same phase, which is very unreasonable. We always tell middle school students that electric field becomes magnetic field, and magnetic field becomes electric field, so electromagnetic waves are formed. If so, when all electric fields become magnetic fields, the electric field is zero and the magnetic field is maximum. When all magnetic fields become electric fields, the magnetic field is zero and the electric field is maximum. So the electric field and magnetic field must have a 90 degree phase difference! In fact, if we consider the magnetic quasi-static electromagnetic field, the electric field and magnetic field do have a 90 degree phase difference. However, when encountering radiation electromagnetic field, we must add displacement current item to the equation of magnetic quasi-static electromagnetic field. At this time, the electromagnetic field we calculated, such as the far field of the antenna, the electric field and the magnetic field are in phase. In this way, we can get that the phase difference between the electric field and the magnetic field of the electromagnetic wave is 0 degrees. In fact, this conclusion is wrong. After the displacement current is added, the definitions of electric field and magnetic field have changed. The electric field and magnetic field calculated by Maxwell equation are completely different from those under the original magnetic quasi-static condition! For radiation problems, such as far field radiation of antenna, the solution of Maxwell equation must require Silver-Müller radiation condition or Sommerfeld radiation condition. When these conditions are met, in fact, the existence of absorber materials at infinity is implied, and these materials are uniformly distributed on the spherical surface with infinite radius. According to Wheeler Feynman's absorber theory, these absorber materials (the sink) will produce advanced waves. This advanced wave is also an electromagnetic field, which interacts with the electromagnetic field of the current element. In this interaction, the electric field and magnetic field are indeed in phase. However, the electric field of the current element is in phase with the magnetic field of the absorber, and the electric field of the absorber is in phase with the magnetic field of the current element (the source). In this way, the energy flow can move from the current element to the absorber.
John Cramer's interpretation of quantum mechanical transactions inherits the absorber theory of Wheeler and Feynman. Support advanced wave is the objective existence of physics. His 1986 paper was cited by 1000 people. It can be seen that it is supported by many people. But this issue is still open. Most scientists have not yet fully accepted the advanced wave. Because the advanced wave moves in the negative direction of time. This is contrary to today's causality. John Cramer thinks that photons are a handshaking process of the retarded wave and advanced wave. Recently, there is a mutual energy flow theory, which further explains that this handshake process generates mutual energy flow. Mutual energy flow is composed of retarded wave and advanced wave. The mutual energy flow can transfer the energy from the current element to the remote absorber charge. Electric field and magnetic field in mutual energy flow are in phase.
In short, to generate a magnetic field from an electric field, to generate electric field from the magnetic field, the electric field and the magnetic field must alternately reach the maximum value. This requires a 90 degree phase between the electric and magnetic fields. But to transfer energy, they must be in the same phase, otherwise we cannot transfer energy. There must be a theory to unify these two things. This problem cannot be solved under the framework of the existing classical electromagnetic theory. You must jump out of the existing framework. I mean that the issue is still open.
