Ok, the voltage drop of the entire circuit lays on the resistor and the capacitor, this is:
\[U_s = U_{R}(t) + U_{c}(t)\]
Where \[U_s\] is the voltage of the source, \[U_{R}(t) = R\cdot{i(t)}\] is the voltage drop in the resistor, and \[U_C(t) = \frac{q(t)}{C}\] is the voltage drop in the capacitor.
The voltage drop in the resistor is based on Ohm's basic law, V = I.R, while the voltage drop in the capacitor can be understood by common sense: the capacity of a capacitor is a constant attribute, and the voltage drop means the potential difference between its plates, which is a charge-dependent value.
*EDIT: The capacity of a capacitor is given by the relation between the charge in its plates and the voltage drop, like: \[C = \frac{Q}{V}\] where Q is the charge and V is the voltage drop. In our case, the charge will be changing as time passes, that's why i used the notation in lower case and t-parameter dependent: \[U_C(t) = \frac{q(t)}{C}\]
*END_EDIT*
In the other hand, we know the current flow is, by definition, the variation in time of the charge of the circuit (which in this case, will be the same current for every element in the circuit), this is:
\[i(t) = \frac{dq(t)}{dt}\]
so the main equation remains:
\[U_s = R\cdot{i(t)} + \frac{1}{C}\cdot{\int_{t_0}^{t}i(t)\cdot{dt}}\]
if we differentiate this equation in time, assuming the source voltage is constant in time, we get:
\[0 = R\cdot{di(t)} + \frac{1}{C}\cdot{i(t)\cdot{dt}}\]
So, regrouping:
\[\frac{-1}{RC}\cdot{dt} = \frac{di(t)}{i(t)}\]
And now, we integrate the whole equation again:
\[\frac{-1}{RC}\cdot{(t-t_0)} = Ln(\frac{i(t)}{i_0})\]
Now we have to take exponentials in all the equation and regroup, so:
\[i(t) = i_0\cdot{e^{\frac{-1}{RC}\cdot{(t-t_0)}}\]
With this you have the expression for the current in the circuit, but still depending on two variables, initial current [text]i_0\] and initial time, \[t_0\]. We can consider the initial time as \[t_0=0\], as a reference point. Now, the initial current will be more tricky.
Imagine there is a switch between the source and the resistor, and we have it off, so the circuit is not working. Current here is null, while voltage drop on the resistor is null and so, voltage drop in the capacitor is null, thus null charge. In the precise moment we switch the circuit on, just in the same exact moment, current will start flowing, but there still will be no charge in the capacitor.
This means all the source voltage will be dropped in the resistor (remember we are still in the exact moment of switching on) and therefore, the value for the initial current, will be \[i_0 = \frac{U_S}{R}\]
Now we can write the exact expression for the current:
\[i(t) = \frac{U_S}{R}\cdot{e^{\frac{-1}{RC}\cdot{t}}}\]
Given this, we can calculate the expression for the voltage drop of the capacitor:
\[U_C = \frac{q(t)}{C}\]
\[U_C = \frac{1}{C}\cdot{\int_{t_0}^{t}i(t)\cdot{dt}}\]
\[U_C = \frac{1}{C}\cdot{\frac{U_S}{R}\cdot{\int_{0}^{t}e^{\frac{-1}{RC}\cdot{t}}\cdot{dt}}}\]
\[U_C = \frac{1}{C}\cdot{\frac{U_S}{R}\cdot{(-RC)}\cdot{\int_{0}^{t}\cdot{\frac{-1}{RC}}e^{\frac{-1}{RC}\cdot{t}}\cdot{dt}}}\]
\[U_C = \frac{1}{C}\cdot{\frac{U_S}{R}\cdot{(RC)}\cdot{\int_{t}^{0}\cdot{\frac{-1}{RC}}e^{\frac{-1}{RC}\cdot{t}}\cdot{dt}}}\]
\[U_C = U_S\cdot\int_{t}^{0}\cdot{\frac{-1}{RC}}e^{\frac{-1}{RC}\cdot{t}}\cdot{dt}\]
\[U_C = U_S\cdot\left( e^{\frac{-1}{RC}\cdot{0}} - e^{\frac{-1}{RC}\cdot{t}} \right)\]
And finally, you have the equation that you started with:
\[U_C = U_S\cdot\left(1-e^{\frac{-1}{RC}\cdot{t}} \right)\]
I hope this is not confusing and is helpful