The equation dQ/dt = -Q/(CR) is a differential equation in the unknown function Q.
So 1/(CR) can be treated as a constant k = 1/(CR) :
dQ/dt = - k Q
=> dQ/dt + kQ = 0
This is one of the simplest forms of diff. eq. , a linear first order diff. eq. with constant coefficients. We use the interesting property of exp(x) that it's derivative is also exp(x). So we try Q(t) = A exp(B x) as solution
=> dQ/dt = AB exp( B x)
=> dQ/dt + k Q = AB exp( B x) + k A exp(B x) = 0
dividing by A exp( B x ) <> 0 yields
B + k = 0 => B = -k
So we have as solution
Q(t) = A exp( -k t)
As k = 1/(CR), this is
Q(t) = A exp( -t/ (RC))
If we call the beginvalue of Q(t) for t=0, Q0, we get
Q(0) = A exp( 0 ) = A = Q0
=> Q(t) = Q0 exp( -t / (RC) )