Say are given any funcition that describes i for an ideal circuit element. How do I find the expression $q(t)$ to describe the amount of charge per unit of time?
The idea was to first derive $q(t)$ from the definition of charge, $i=dq/dt$. to do this, I integrate both sides with respect to $t$, to get...
$$i=\frac{dq}{dt}$$
$$\int_{0}^{t}i\, dq\, \; =\; \int_{0}^{t}dq$$ $$\int_{0}^{t}i(q)\, dq\, \; =\; q(t)$$
So, now in the problems I will be given a value for $i$ at $t=0$. $i=5$, $i=20e{^{-5000t}}$, $i=20\, cos\, (5000t)$, etc. None of this is homework.
This is the part I'm not sure how to do.
For $i=5$, I could say$$\int_{0}^{t}5(q)\, dq\, \; =\; q(t)$$, $$5t=q(t)$$
For $i=20e{^{-5000t}}$, I could say$$\int_{0}^{t}20e{^{-5000t}}(q)\, dq\, \; =\; q(t)$$, $$t\,20e{^{-5000t}}=q(t)$$
In this case, I should get $4000\: \mu C$. If anyone can help me with this one, I should be able to figure out the third case by myself. :)
Thanks so much.
For those curious, this example is on page 38 of Electric Circuits, Nilsson [10th]


No, you have to respect the rules for integrals: $$q(t)=\int_{0}^{t}20e{^{-5000t'/\text{s}}}\text{A}\, dt'\, \; =\; \left[\frac{20\text{s}}{-5000}\cdot e{^{-5000t'}}\right]^t_0 \; {= \; \left[-0.004\cdot e{^{-5000t'}}\text{A}\text{s}\right]^t_0 }{= 0.004\cdot(1-e{^{-5000t}})\ \text{A}\text{s},} $$ which gives you $0.004C = 4000\mu C$ for $t \to \infty$.
For clarity since asked in the comments:
Why $q(t)=\int_{0}^{t}20e{^{-5000t'/\text{s}}}\text{A}\, dt'$?
$$q(t)= \int_0^ti(t')dt',$$ because the total charge is the time integral over the current during the observed time period.
Why not $q(t)=\int_{0}^{t}20e{^{-5000'/\text{s}}}\text{A}\, dt$?
It has a different meaning (and is somewhat not well defined). I just answered it here because this is another question.
Why not something like $r$ instead of $t'$?
In physics, we tend to use as similar symbol as possible, so $t'$ is a good call. This way is stays clear this means time.
You are right, it often means a space derivative, so using $\tilde{t}$ would be a somehow better option.
But you can also expect this not meaning a derivative, since you are looking at electrics here.
I'm going to let it stay since you asked and this and are surely not the only one confused by this.
In calculus (in math), you can use any unused variable, since you only care about the integral and not a specific use or meaning.
Why not $q(t)=\int_{0}^{t}20e{^{-5000t'/}}\, dt'$?
A (Ampére) and s (second) since you should always care about having the right dimensions.
There can happen bad things if dimensions are not clear for everyone using the same units/system.
Especially as a beginner, be careful.
(And as a veteran you habe possibly made enough errors because of this to stay careful. :D)