The differential equation, which I assume you already have, is
dq/dt + (1/RC)q = E(t)/R
where I have assumed that E(t) is the externally applied voltage.
The Laplace transform of this equation is
-q(0)+ sQ + (1/RC)Q = (1/R)L{E(t)}
where Q is the Laplace transform of q, and L{} denotes "Laplace transform of"
From the definition, L{E(t)} is given by
3
∫ Eo e^(-st) dt
1
= Eo(-1/s) e^(-st) (evaluated at 1 and 3)
= (Eo/s)[e^(-s) - e^(-3s)]
Putting this into the Laplace transformed equation and applying the initial condition q(0) = 0,
(s + (1/RC))Q = (Eo/R)[e^(-s) - e^(-3s)]/s
Solving for Q,
Q = (Eo/R)[e^(-s) - e^(-3s)]/(s(s + (1/RC))
Using partial fraction decomposition, it is easy to show that
1/(s(s + (1/RC)) = RC[(1/s) - 1/(s + (1/RC))]
so Q may be written
Q = C Eo e^(-s)[(1/s) - 1/(s + (1/RC))] - C Eo e^(-3s)[(1/s) - 1/(s + (1/RC))]
There's a shifting theorem that says
L^(-1){e^(-as) F(s)} = U(t-a)f(t-a)
where F(s) is the Laplace transform of f(t) and U(t-a) is the unit step function
U(t-a) = 0 for t < a, U(t-a) = 1 for t > a
Since
L^(-1){[(1/s) - 1/(s + (1/RC))} 1 - e^(-t/(RC))
we get
q(t) = C Eo[(1 - e^(-(t-1)/(RC))]U(t-1) - C Eo[(1 - e^(-(t-3)/(RC))]U(t-3)
This is an elegant, if somewhat obscure, way to write a single expression for the solution for all times. More conventionally,
q(t) = 0 for t < 1
q(t) = C Eo[(1 - e^(-(t-1)/(RC))] for 1 ≤ t ≤3
q(t) = C Eo[e^(-(t-3)/(RC)) - e^(-(t-1)/(RC))] = C Eo e^(-t/(RC))[e^(3/(RC) - e^(1/(RC))] for t > 3