Circuit with switch - express the current for different times
Copying the answer I gave when you posted the same question on Physics.SE:


  I suppose that in this type of circuit the current and the voltage are in phase, 


This question is asking for a transient solution, not an ac steady-state solution. So we can't really talk about the phase of the voltage or the current.


  meaning that immediately after the switch is shut the current should be I=0?


This conclusion is incorrect.


  Can't I just assume that the capacitor will be fully charged


No. It's explicitly stated in the problem, "For t&lt;0 the switch is open and the capacitor is uncharged". The charge on a capacitor can not change instantaneously (when current is finite), so the charge on the capacitor is also 0 in the instant after the switch is closed.

A corollary that will help you solve this is that the voltage waveform across a capacitor is continuous.


  I don't seem to find an approach getting expressions for the current and the charge after a very long time


The usual way to find the steady state dc response is to analyze the circuit in the dc regime, treating all capacitors as open circuits and all inductors as short circuits.


  since U is constant, does that mean that the current is 0? Seems kind of unlikely.


No it's not unlikely. If the capacitor continued to accumulate charge after a long time, it's voltage would be increasing without bound, which would cause problems.


  I'm supposed to set up a differential equation which then would give me a function with which I can find Q and I at certain points?


Start with 

$$I_c = C\frac{\mathrm{d}V}{\mathrm{d}t}$$

and write \$I\$ in terms of other quantities you know (like the source voltage, the capacitor voltage, and the resistor values).