# A bit lost on the RC circuit differential equation

1. Jul 20, 2009

### planck42

1. The problem statement, all variables and given/known data
Solve the differential equation $$R\frac{dq}{dt} + \frac{q}{C} = v_0$$

R is resistance, q is charge, t is time, C is capacitance, and $$v_0$$ is the EMF of the power supply.

2. Relevant equations
First-order linear differential equation solving method

3. The attempt at a solution
This is a first-order linear differential equation, so let's apply the standard steps to solve it. First, I calculated the integrating factor to be $$e^{\frac{t}{RC}}$$. Upon multiplying through by this factor and integrating, I got $$\frac{dq}{dt}e^{\frac{t}{RC}} + qe^{\frac{t}{RC}}$$ on the left side, and $$\int{\frac{v_0}{R}e^{\frac{t}{RC}}$$ on the right side. This integrates to $$v_{0}Ce^{\frac{t}{RC}}$$, neglecting the arbitrary constant. So $$qe^{\frac{t}{RC}}=v_{0}Ce^{\frac{t}{RC}}$$, which simplifies to $$q=v_{0}C$$, an unsurprising but disappointing result since I'm trying to find q in terms of time. Perhaps there is something wrong with one of my steps? This has been bugging me for quite some time and I would appreciate a kick in the right direction.

2. Jul 20, 2009

### AUMathTutor

You can't neglect the arbitrary constant, naturally. Include the arbitrary constant, and they you'll have the right answer.

To find the arbitrary constant, you will need to know q(t) at t=0, and use that to solve.

Does that make sense? The arbitrary constant MUST BE INCLUDED.

I didn't check the rest of your derivation too thoroughly, but it looks right. Try what I said and see if that doesn't give you the right answer.

(To see if it's the right answer, differentiate and see if it works)

3. Jul 20, 2009

### planck42

I believe that $$q_0$$ is zero since there is no current flowing and therefore no charge on the capacitor.

4. Jul 20, 2009

### Staff: Mentor

The capacitor's q(t) depends on the voltage across the capacitor, not the current. So if v(t=0) across the capacitor is the same as the supply voltage, then there is no current through the series resistor to drop the voltage, and your solution is correct. However, as AU is alluding to, if v(t=0) = 0, then what happens? You will get a charge buildup that has a form involving the exponential.

And BTW, I think you should consider a negative sign in your exponent.... The physical sitation of this circuit will have exponential decays in it, not exponential growths...

5. Jul 20, 2009

### planck42

Thank you! I forgot that the capacitor only cares about the potential difference across itself(and its own capacitance).

EDIT: I now understand that it is part of the transient term $$q_{0}e^{\frac{-t}{RC}}$$, so that the charge on the capacitor approaches $$v_{0}C$$ as time increases indefinitely. If v(t=0) is zero, then it appears that the only way for it to be true is if $$q_{0}=-v_{0}C$$

Last edited: Jul 20, 2009
6. Jul 20, 2009

### AUMathTutor

No, q(0) = 0. Initially, there is no charge on the capacitor because, simply put, no charge has made it there yet.

In the end, in the limit, there will be Q = CV of charge on the capacitor. It will approach this exponentially. Basically, you have

q*exp(t/RC) = CVexp(t/RC) + k
q = CV + k*exp(-t/RC)

Literally all you need to do now is say that when t=0, q=q(0) and solve for k. End of story. Done.