\begin{align*}
\ket{\Psi_{m}(x)}= &\cos\theta_m \left( a_L \exp(-i \int_0^x \omega_m(x)/2 dx ) \ket{\nu_L(x)} + a_H \exp(i\int_0^x \omega_m(x)/2 dx) \ket{\nu_H(x)} \right) \\
&+ \sin\theta_m \left( -a_H^* \exp(-i \int_0^x \omega_m(x)/2 dx ) \ket{\nu_L(x)} + a_L^* \exp(i\int_0^x \omega_m(x)/2 dx) \ket{\nu_H(x)} \right) \\
=& \left(\cos\theta_m a_L\exp(-i \int_0^x \omega_m(x)/2 dx ) - \sin\theta_m a_H^* \exp(-i \int_0^x \omega_m(x)/2 dx ) \right)\ket{\nu_L(x)} \\
& +\left( \cos\theta_m a_H \exp(i\int_0^x \omega_m(x)/2 dx) + \sin\theta_m a_L^* \exp(i\int_0^x \omega_m(x)/2 dx) \right)\ket{\nu_H(x)} \\
=& \left(\cos\theta_m a_L\exp(-i \int_0^x \omega_m(x) /2 dx ) - \sin\theta_m a_H^* \exp(-i \int_0^x \omega_m(x)/2 dx ) \right)( \cos\theta_m \ket{\nu_e} - \sin \theta_m \ket{\nu_x} ) \\
& +\left( \cos\theta_m a_H \exp(i\int_0^x \omega_m(x)/2 dx) + \sin\theta_m a_L^* \exp(i\int_0^x \omega_m(x)/2 dx) \right) ( \sin\theta_m \ket{\nu_e} + \cos\theta_m \ket{\nu_x} ) \\
=& \left[\left(\cos\theta_m a_L\exp(-i \int_0^x \omega_m(x)/2 dx ) - \sin\theta_m a_H^* \exp(-i \int_0^x \omega_m(x)/2 dx ) \right) \cos\theta_m \right.\\
&\left. + \left( \cos\theta_m a_H \exp(i\int_0^x \omega_m(x)/2 dx) + \sin\theta_m a_L^* \exp(i\int_0^x \omega_m(x)/2 dx) \right) \sin\theta_m \right]\ket{\nu_e} \\
& + \left[ -\left(\cos\theta_m a_L\exp(-i \int_0^x \omega_m(x)/2 dx ) - \sin\theta_m a_H^* \exp(-i \int_0^x \omega_m(x)/2 dx ) \right) \sin \theta_m \right.\\
& \left. + \left( \cos\theta_m a_H \exp(i\int_0^x \omega_m(x)/2 dx) + \sin\theta_m a_L^* \exp(i\int_0^x \omega_m(x)/2 dx) \right) \cos\theta_m \right] \ket{\nu_x}
\end{align*}