The differential equation obtained for solving the current is as follows.
The exact solution of the above differential equation according to wolfram alpha is:
Euler's method is used to implement the numerical solution for the above equation which after a certain extent outputs nearly exact solution with not much computational power. This article contains further information.