Equation of current in charging of capacitor
Your schematic makes only sense if theres a series resistor between the capacitor and the power source.

In this case the voltage and current waveforms for charging the capacitor are:

\$ V_{cap}(t) = V_s \cdot \left( 1 - e^{-t/\tau}\right) \$ and

\$ I_{cap}(t) = C \cdot \frac{dV_{cap}(t)}{dt} = C \cdot V_s \cdot \frac{1}{\tau}\cdot e^{-t/\tau} = V_s \cdot \frac{1}{R}\cdot e^{-t/\tau}\$

where \$ \tau = R \cdot C\$



It all results from the equation:
\$ I(t) = C\cdot \frac{dV(t)}{dt}\$. This is the characteristic eqaution for a capacitor.

If you have a series resistance in your schematic and use the KVL You get:

\$ V_s  = V_R(t) + V_{cap}(t)\$.

With

\$ U_R(t) = R \cdot I_{cap}(t) = R \cdot C \cdot \frac{dV_{cap}(t)}{dt}\$

you get:

\$ V_s = R \cdot C \cdot \frac{dV_{cap}(t)}{dt} + V_{cap}(t) \$

you can solve this differential equation using different methods, for example using Laplace Transform. 

The solution is the equation above.



The circuit without resistance doesn't produce a waveform. If you close the switch, the voltage change on the cap would be infinitely high which results in an infinite current. The capacitor is charged to its full voltage instantly.