RC circuit equations
Initial conditions and constant of integration.

$$\begin{align*}
I_R &amp;= \frac{V_R}{R} = \frac{V_S-V_C}{R}\\
I_C &amp;= C\cdot\frac{\textrm{d}V_C}{\textrm{d}t}\\
\textrm{when }I_R\textrm{ is positive, d}&amp;V_C\textrm{ is also positive}\\\\
&amp;\therefore I_R = I_C\\\\\\\\
\frac{V_S-V_C}{R} &amp;= C\cdot\frac{\textrm{d}V_C}{\textrm{d}t} \\\\
\textrm{d} t&amp;=\frac{R \:C}{V_S-V_C}\:\:\textrm{d}V_C \\\\
\int \textrm{d} t&amp;=-R\: C\int \frac{\textrm{d}V_C}{V_C-V_S}\\\\
\textrm{setting }u=V_C-V_S,\quad &amp;\therefore \textrm{d}u=\textrm{d}V_C\\\\
\int \textrm{d} t&amp;=-R\: C\int \frac{\textrm{d}u}{u}\\\\
t+C_0&amp;=-R\:C\:\operatorname{ln}\left(u\right)\\\\
-\frac{t}{R\:C\:}-\frac{C_0}{R\:C\:}&amp;=\operatorname{ln}\left(V_C-V_S\right)\\\\
e^{\frac{-t}{R\:C\:}}\cdot e^{\frac{-C_0}{R\:C\:}}&amp;=V_C-V_S\\\\
A_0\cdot e^{\frac{-t}{R\:C\:}}&amp;=V_C-V_S\\\\
\textrm{from the initial conditions at }t=0\textrm{ and }V_C&amp;=0,\textrm{ we know }A_0=-V_S\\\\
\therefore -V_S\cdot e^{-\frac{t}{R\:C\:}}&amp;=V_C-V_S\\\\
V_S-V_S\cdot e^{\frac{-t}{R\:C\:}}&amp;=V_C\\\\
V_C&amp;=V_S\cdot\left(1- e^{\frac{-t}{R\:C\:}}\right)
\end{align*}$$