Forced Harmonic Oscillator in Heisenberg Picture 
>
  The Hamiltonian of the forced harmonic oscillator is 
  $$H(t)=\frac{P^2}{2m}+\frac{1}{2}m\omega^2X^2-qE_0X\cos\omega^{\prime}t \tag{1} $$
  Go to the Heisenberg picture and find 
  $$\frac{dX}{dt} \quad \text{and} \quad \frac{dP}{dt}$$
  Finally solve for the position operator
  $$X(t)$$
  with $X(0)=X_0$ and $\frac{dX}{dt}\Big|_{t=0}=0$

Going to the Heisenberg picture, 
$$X(t) = e^{i\frac{Ht}{\hbar}}X e^{-i\frac{Ht}{\hbar}} \tag{2.1}$$
$$P(t) = e^{i\frac{Ht}{\hbar}}P e^{-i\frac{Ht}{\hbar}} \tag{2.2}$$
it can be found that
$$X(t)=\left(X-\frac{qE_0}{m\omega^2}\cos\omega^{\prime}t\right)\cos\omega t + \frac{P}{m\omega}\sin\omega t +  \frac{qE_0}{m\omega^2}\cos\omega^{\prime}t \tag{3.1}$$
$$P(t)= -m\omega\left(X-\frac{qE_0}{m\omega^2}\sin\omega^{\prime}t\right)\cos\omega t + P \cos\omega t \tag{3.2}$$
with the identity
$$e^{i\frac{Ht}{\hbar}}O e^{-i\frac{Ht}{\hbar}}=O + \left(\frac{it}{\hbar}\right)[H,O]+ \frac{1}{2!}\left(\frac{it}{\hbar}\right)^2[H,[H,O]]+\cdots \tag{4}$$
Eq.(3.1) has no free parameter left, how can I solve for X(t) from the initial condition?
Also, I tried to check if my result satisfy Heisenberg equation of motion:
$$\frac{dO_H(t)}{dt} = \frac{i}{\hbar}[H_H(t),O_H(t)]\tag{5}$$
and got
$$\frac{dX(t)}{dt} = \frac{i}{\hbar}[H_H(t),O_H(t)]=\frac{P(t)}{m} \tag{6.1}$$
$$\frac{dP(t)}{dt} =\frac{i}{\hbar}[H_H(t),P_H(t)]= - m \omega^2\left(X - \frac{qE_0}{m\omega^2}\cos(\omega^{\prime}t)\right)\tag{6.2}$$
Plugging eq.(3.2) into eq.(6.1) does not give the time derivative version of eq.(3.1).
I can't find what's the problem in the above analysis.
 A: Everything else is correct except equations (2.1) to (3.2). Equation (4) cannot be used to since the Hamiltonian is time dependent. What you have to do is take the derivative of (6.1) and substitute equation (6.2). By doing this you will get
$$\frac{d^2X(t)}{dt^2}+\omega^2X(t)=\frac{qE_0}{m}\cos{\omega't}$$
I have solved this equation by assuming $\omega=\omega'=q=E_0=m=1$ and $X(0)=1,\dot{X}(0)=0$ for simplicity and got the result as
$$X(t)=\frac{1}{4}(2\cos^3t+2\cos t+2t\sin t+\sin{2t}\sin{t})$$
On simplifying one gets
$$X(t)=\frac{1}{2}t\sin{t}+\cos{t}$$
Hope this helps.

Edit
The answer given by @CosmasZachos is more accurate and general since I have taken $\omega=\omega'$. Though this solution is correct (checked it on Mathematica) it works only when the condition is satisfied, while his solution works in general.
A: @yu-v suggested how to solve the problem, but you seem interested in bypassing the teacher's suggestion in favor of  a (difficult!) direct evaluation. 
Actually, in the Heisenberg picture, the problem behaves very much like its classical mechanics limit.
No need to know U explicitly, if you bypass the wrong equations (2.1) to (3.2). In the Heisenberg picture, 
$$
O_H(t) \equiv U^\dagger O_S(t) U,
$$
where, here, U is the evolution operator you were not quite asked to find, and is a messy path-ordered exponential — distinctly not what you misuse in (2.1) & (2.2).
You should have, instead, 
$$
 X(t) =U^\dagger X U , \qquad P(t) =U^\dagger P U,  \qquad \qquad H(t)_H =U^\dagger H(t)_S U ,
$$
where $H_S$ is the time-dependent Hamiltonian actually given to you, above. 
You actually need not evaluate explicitly P(t),X(t),HH, as long as you appreciate the similarity transformation involved and evaluate the intercalated commutators in the Schroedinger picture you were given. This is the heart of the problem and you must convince yourself of the intercalation principle involved. 
Specifically, in the Heisenberg equations of motion, 
$$\frac{dX(t)}{dt} = \frac{i}{\hbar}[H_H(t),X_H(t)] \tag{6.1}$$
$$\frac{dP(t)}{dt} =\frac{i}{\hbar}[H_H(t),P_H(t)] \tag{6.2}$$
you must observe
$$ \frac{i}{\hbar} [H_H(t),X_H(t)]=\frac{i}{\hbar}U^\dagger [H_S(t),X] U=U^\dagger P U ~/m = P(t)/m  \tag{6.3}$$
$$ \frac{i}{\hbar} [H_H(t),P_H(t)]=\frac{i}{\hbar}U^\dagger [H_S(t),P] U  \\  =  U^\dagger  (-m\omega^2 X + qE_0 \cos (\omega' t)) U = -m\omega^2 X(t) +qE_0 \cos (\omega't), \tag{6.4}$$
resulting in $P(t)=m dX(t)/dt  $,   and therefore 
$$\frac{d^2X(t)}{dt^2} = -\omega^2 X(t) + (qE_0/m) \cos (\omega' t) .\tag{6.5}   $$
The solution to (6.5) is the "classical" result
$$
X(t)=\left( X_0-\frac{qE_0}{m(\omega^2-\omega'^2)}  \right ) \cos (\omega t) + \frac{qE_0}{m(\omega^2-\omega'^2)}  \cos(\omega ' t) ,
\tag {3.3}$$ 
where  the vanishing velocity initial condition has  already been enforced setting a momentum-like integration constant equal to zero (hmm).
Incidentally, since U(0)=I, $X_0=X$, the Schroedinger operator.
A far cry from (3.1),(3.2). 
PS A friendlier version of (3.3) might well be 
$$  \bbox[yellow,5px]{
X(t)=  X_0  \cos (\omega t) + \frac{2qE_0}{m(\omega^2-\omega'^2)}  
\sin\left (\frac{\omega ' +\omega}{2} t\right ) \sin \left (\frac{\omega ' -\omega}{2} t\right )}.
\tag {3.3} 
$$
It is then evident how @Manvendra Somvanshi 's on-resonance limit comes about: as the driving frequency approaches the natural frequency, $\omega' \to \omega$, the oscillation gets to increase in time without bound, in the runaway limit,
$$
X(t)\to X_0  \cos (\omega t) + \frac{qE_0 t}{2m\omega}  
 \sin   ( \omega  t ).
$$
If you used any of this, you should let your instructor know.
