I cant figure out the differential equation made in RC circuits During charging E = iR + q/C .......I understand this During discharging my book says that since E = 0 , iR + q/C = 0 and by using i = dq/dt it solves the equation But using kirchoff's law i end up with the equation q/C - iR = 0. I searched a bit and some books have used the equation q/C - iR = 0( that i came up with) but then they substitute i as - dq/dt. Which is the correct differential equation and if we substitue i as - dq/dt we should substitute it as negative dq/dt in both the cases. Why in one case we susbsitute as positive dq/dt and in other negative dq/dt???