Deriving time-dependent Hamiltonian Consider  a two state system $\rho$ with some Hamiltonian $H$. I am interested in the specifics of the systems time-evolution.
The article I am reading gives me the following time evolution:
$$\lvert \psi(t) \rangle = \cos(\Omega t) e^{i \omega_1 t} \lvert 1 \rangle + \sin(\Omega t) e^{i \omega_2 t} \lvert 2 \rangle $$
This makes it fairly obvious that the corresponding Hamiltonian for this unitary transformation is time-dependent. 
Can anyone help me derive the Hamiltonian and show me how it's done?
As far as I know for time-dependent Hamiltonians we have the relation
$$U =  e^{i \int H(t) dt}$$
I've looked but wasn't able to find help. Any help will be greatly appreciated (:
 A: You can directly use Schrödinger's equation:
$$ i \hbar \frac{d}{dt} \lvert\psi(t)\rangle = H \lvert\psi(t)\rangle $$
Start with the given time evolution:
$$
\begin{align}
\lvert\psi(t)\rangle &= \cos(\Omega t) e^{i \omega_1 t} \lvert 1\rangle  \\
                     &+ \sin(\Omega t) e^{i \omega_2 t} \lvert 2\rangle  \tag{1}
\end{align}
$$
Heading for Schrödinger's equation, you can straight-forwardly calculate its time-derivative:
$$
\begin{align}
i \hbar \frac{d}{dt} \lvert\psi(t)\rangle =
&- i\hbar \Omega   \sin(\Omega t) e^{i\omega_1 t} \lvert 1\rangle  \\
&-  \hbar \omega_1 \cos(\Omega t) e^{i\omega_1 t} \lvert 1\rangle  \\
&+ i\hbar \Omega   \cos(\Omega t) e^{i\omega_2 t} \lvert 2\rangle  \\
&-  \hbar \omega_2 \sin(\Omega t) e^{i\omega_2 t} \lvert 2\rangle  \tag{2}
\end{align}
$$
Now let's make the most general approach for a time-dependent Hamiltonian in the given two-state system:
$$
\begin{align}
H(t) &= H_{11}(t) \lvert 1\rangle \langle 1 \rvert  \\
     &+ H_{12}(t) \lvert 1\rangle \langle 2 \rvert  \\
     &+ H_{21}(t) \lvert 2\rangle \langle 1 \rvert  \\
     &+ H_{22}(t) \lvert 2\rangle \langle 2 \rvert
\end{align}
$$
Apply this Hamiltonian to the given time evolution (1),
use the orthonormality relations between $\lvert 1\rangle$ and $\lvert 2\rangle$,
and you get:
$$
\begin{align}
   H(t) \lvert\psi(t)\rangle
   &= H_{11}(t) \cos(\Omega t) e^{i\omega_1 t} \lvert 1\rangle  \\
   &+ H_{12}(t) \sin(\Omega t) e^{i\omega_1 t} \lvert 1\rangle  \\
   &+ H_{21}(t) \cos(\Omega t) e^{i\omega_2 t} \lvert 2\rangle  \\
   &+ H_{22}(t) \sin(\Omega t) e^{i\omega_2 t} \lvert 2\rangle  \tag{3}
\end{align}
$$
According to Schrödinger's equation you can equate (2) and (3).
By comparing the coefficients you get the final result:
$$
\begin{align}
H_{11}(t) &= - \hbar \omega_1 \\
H_{12}(t) &= -i\hbar \Omega e^{ i(\omega_1 - \omega_2) t} \\
H_{21}(t) &= +i\hbar \Omega e^{-i(\omega_1 - \omega_2) t} \\
H_{22}(t) &= - \hbar \omega_2
\end{align}
$$
Notice that the Hamiltonian turned out to be Hermitian as it should be.
A: This is  hardly an answer, but an appreciation comment to @Thomas_Fritsch 's comment. (There is no venue for extended comments...)
In any case, it is evident from the OP's evolution equation that 
$$
|\psi(t)\rangle= U(t) |\psi(0)\rangle= U|1\rangle .
$$ 
From the unitarity of U it is then straightforward to fix the entire matrix from its first column, 
$$U=\exp\left ( it \begin{pmatrix}
      \omega_1&0\\
      0&\omega_2
    \end{pmatrix}\right ) \exp\left ( t\Omega \begin{pmatrix}
      0&-1\\
      1&0
    \end{pmatrix}\right )\\  
\equiv M \exp\left ( t\Omega \begin{pmatrix}
      0&-1\\
      1&0
    \end{pmatrix}\right ),  $$
a very simple unitary evolution indeed. 
NB.  $\exp\left ( t\Omega \begin{pmatrix}
      0&-1\\
      1&0
    \end{pmatrix}\right )= \cos (t\Omega )   \begin{pmatrix}
      1&0\\
      0&1
    \end{pmatrix} + \sin (t\Omega)  \begin{pmatrix}
      0&-1\\
      1&0
    \end{pmatrix}           $.  Moreover,
$$
U=  \exp\left ( tM \begin{pmatrix}
      0&-\Omega\\
      \Omega&0
    \end{pmatrix} M^\dagger\right )~~ M,
$$
evoking a backhanded backwards interaction rep, as @Artem suggests in his comment.
If you must look at the less central Hamiltonian, consider Duhamel's formula  for operators that need not commute with their derivative,
$$
i\left (\frac{d}{dt} U\right ) ~ U^\dagger\\
 = - \begin{pmatrix}
      \omega_1&0\\
      0&\omega_2
    \end{pmatrix} U U^\dagger +i M \Omega \begin{pmatrix}
      0&-1\\
      1&0
    \end{pmatrix}\exp\left ( t\Omega \begin{pmatrix}
      0&-1\\
      1&0
    \end{pmatrix}\right )U^\dagger\\  = - \begin{pmatrix}
      \omega_1&0\\
      0&\omega_2
    \end{pmatrix}  + iM  \begin{pmatrix}
      0&-\Omega\\
      \Omega&0
    \end{pmatrix} M^\dagger\\  =  -\begin{pmatrix}
      \omega_1&0\\
      0&\omega_2
    \end{pmatrix}  +  \begin{pmatrix}
      0&-i\Omega  e^{it(\omega_1-\omega_2)}\\
      i\Omega e^{-it(\omega_1-\omega_2)}&0
    \end{pmatrix}  ,  
$$
amounting to the Hermitian Hamiltonian of Thomas. This Hamiltonian fails to commute with its time integral, as  the OP implicitly noted.
