# Finding general solution of first order DE's using integrating factor

I am asked to find the general solution of $$R\frac{dq(t)}{dt}+\frac{q(t)}{C}-V_0=0$$

I re-arrange so it is in the correct format.

$$\frac{dq(t)}{dt}+\frac{1}{CR}\cdot{q(t)}=\frac{V_0}{R}$$

Integrating factor => $e^{\int{p(x)dx}}$

In this case $p(x)=\frac{1}{CR}$

$e^{\int{\frac{1}{CR}dt}}$=$e^{\frac{t}{CR}}$

Multiply through by the IF

$$e^{\frac{t}{CR}}\frac{dq(t)}{dt}+e^{\frac{t}{CR}}\frac{1}{CR}{q(t)}=e^{\frac{t}{CR}}\frac{V_0}{R}$$

Product rule states that => $u\frac{dv}{dx}+v\frac{du}{dx}=\frac{d}{dt}(uv)$ so

$$e^{\frac{t}{CR}}\frac{dq(t)}{dt}+e^{\frac{t}{CR}}\frac{1}{CR}{q(t)}=\frac{d}{dt}(e^{\frac{t}{CR}}q(t))$$ $$\frac{d}{dt}(e^{\frac{t}{CR}}q(t))=e^{\frac{t}{CR}}\frac{V_0}{R}$$

Integrating both sides

$$\int{\frac{d}{dt}(e^{\frac{t}{CR}}q(t))dt=\int{e^{\frac{t}{CR}}\frac{V_0}{R}}}dt$$ $$e^{\frac{t}{CR}}q(t)=\frac{V_0}{R}\int{e^{\frac{t}{CR}}}dt$$

That last step I wasn't sure about. Is $V_0$ a constant in this case? I thought it was dependent on t as well.. Anyway

$$e^{\frac{t}{CR}}q(t)=\frac{V_0}{R}\cdot{\frac{1}{(\frac{1}{CR})}}\cdot{e}^{\frac{t}{CR}}+K$$ $$e^{\frac{t}{CR}}q(t)=\frac{V_0CR}{R}\cdot{e}^{\frac{t}{CR}}+K$$ $$e^{\frac{t}{CR}}q(t)=V_0C\cdot{e}^{\frac{t}{CR}}+K$$ Dividing by $e^{\frac{t}{CR}}$ $$q(t)=V_0C+\frac{K}{e^{\frac{t}{CR}}}$$ (K=the unknown constant)

I have an initial condition that states when t=0, q(t)=0 and am asked to find the particular solution.

$$q(0)=0$$ $$0=V_0C+Ke^{-\frac{0}{CR}}$$ $$=V_0C+Ke^0$$ $$=V_0C+K$$ $$K=-V_0C$$

Subbing K back in

$$q(t)=V_0C+(-V_0Ce^{-\frac{t}{CR}})$$ $$q(t)=V_0C-V_0Ce^{-\frac{t}{CR}}$$

Would this seem correct?

• You said I could write the last line in a cleaner way, could you show me what you mean? Or do you mean $q(t)=V_0C+Ke^{-\frac{t}{CR}}$ – user88720 Apr 29 '14 at 23:51
• Okay thanks. I also have an initial condition that says when t=0, q(t)=0. I have put that in the end of my question above although I'm not sure if it is correct – user88720 Apr 30 '14 at 1:17
• Sorry when you say recall I'm not sure what you mean. I try to upvote on comments that are helpful although I'm not sure how to accept a comment as an answer – user88720 Apr 30 '14 at 1:32

$$\large q(t) = C V_0 \left(1-e^{-\frac{t}{C R}}\right)$$