# How do I find a function from a differential equation?

Hey, I'm looking for a guide on how I find Q given the following, where $a$ and $b$ are constants:

$$\frac{dQ}{dt} = \frac{a + Q}{b}$$

I have the answer and working for specific case I'm trying to solve but do not understand the steps involved. A guide on how I can solve this, with an explanation of each step would be much appreciated.

-
$a$ and $b$ are constants? – J. M. Sep 14 '10 at 10:37
Yeah, sorry, I should have made that clear. – Sam152 Sep 14 '10 at 10:38
I think that «differential equation that is in terms of itself» is just a sinomym for «differential equation». Maybe you could edit your title so that it becomes more obvious what you mean? – Mariano Suárez-Alvarez Sep 14 '10 at 13:53

To deal well with substitution of variables in differential equations you should know when there is a differential operator and when there is a derivative. In the first case a variable is linked with differential operator and changing it you should also change a differential operator, in the second a derivative is just a function so you can simultaneously change the same argument in all equation's functions.

Let's see on your equation.

$$\frac{dQ}{dt}=\frac{a+Q}{b}$$

And rewrite it using a differential operator notation:

$$\frac{d}{dt}[Q(t)]=\frac{a+Q(t)}{b}$$

Let's define a functional map $F_1(f)(x)=f(x)-a$, obvious this map is bijection and let $g$ be a solution of $F_1(g)=Q$. So $Q(t)=F_1(g)(t)=g(t)-a$ and we rewrite the equation:

$$\frac{d}{dt}[g(t)-a]=\frac{a+g(t)-a}{b}$$

Reduce it and calculate a derivative:

$$g'(t)=\frac{1}{b}g(t)$$

And back to a differential operator notation:

$$\frac{d}{dt}[g(t)]=\frac{1}{b}g(t)$$

Repeat the trick with a map $F_2(f)(x)=f(\frac{1}{b}x)$, let $w$ be a solution of $F_2(w)=g$, so $g(t)=F_2(w)(t)=w(\frac{1}{b}t)$ and substitute it into the equation:

$$\frac{d}{dt}[w(\frac{1}{b}t)]=\frac{1}{b}w(\frac{1}{b}t)$$

Calculate a derivative and reduce:

$$w'(\frac{1}{b}t)=w(\frac{1}{b}t)$$

But there is no a differential operator, so we change an argument $\frac{1}{b}t$ to $t$ in whole equation:

$$w'(t)=w(t)$$

It's known that a solution is $w(t)=C_1e^t$ and $Q=F_1(F_2(w))$ so $Q(t)=C_1e^{\frac{1}{b}t}-a$

This is a very verbose solution, but then understand it you can just use rules of substitution of variables and solve an equation in a few lines.

-

Yet, another method for solving this differential equation is to look at it as a linear differential equation, whose general form is:

$$y'(x) = a(x) y(x) + b(x) \ , \qquad\qquad\qquad [1]$$

where $a(x), b(x)$ are arbitrary functions depending on the variable $x$. In your case:

$$x = t \ , y(x) = Q(t) \ , b(x) = \frac{a}{b} \quad \text{and}\quad a(x) = \frac{1}{b} \ .$$

A general procedure for solving [1] is the following:

1. First, try to solve the associated homogeneous linear differential equation

$$y' = a(x)y \ . \qquad\qquad\qquad [2]$$

This is easy: the general solution is

$$y = K e^{A(x)} \ , \qquad\qquad\qquad [3]$$

where $K\in \mathbb{R}$ is an arbitrary constant and $A(x) = \int a(x)dx$ is a primitive function of $a(x)$.

2. Once you have the general solution [3] of [2], you apply variation of constants; that is, you look for solutions of [1] of the following kind:

$$y = K(x) e^{A(x)} \ . \qquad \qquad \qquad [4]$$

Here, we have replaced the arbitrary constant $K$ by an arbitrary unkown function $K(x)$ (hence the name "variation of constants") to be determined. How? Imposing that we want [4] to be a solution of our first differential equation [1]. It goes like this: if you replace $y$ in [4] into [1], you get

$$K'(x) e^{A(x)} + K(x) A'(x) e^{A(x)} = a(x) K(x) e^{A(x)} + b(x) \ .$$

Since $A'(x) = a(x)$, this is the same as

$$K'(x) e^{A(x)} = b(x) \ .$$

So

$$K(x) = \int b(x)e^{-A(x)}dx + C \ ,$$

where $C \in \mathbb{R}$ is an arbitrary constant. Now you put this $K(x)$ into [4] and get the general solution of your differential equation:

$$y(x) = Ce^{A(x)} + e^{A(x)}\int b(x) e^{-A(x)}dx \ . \qquad\qquad\qquad [5]$$

Since I've never could remember formula [5], I use to repeat the whole process for each particular linear differential equation, which is not hard and you can do it for yours.

-
"Since I've never could remember formula [5]..." - Ditto. +1 :D – J. M. Sep 14 '10 at 12:31

Edit: Your particular differential equation can be solved without any calculation if you know the solutions of $$\frac{dQ}{dt} = Q$$, i.e. $C\exp(t), C\in\mathbb{R}$.

Note that, if $f$ is a solution to $\frac{dQ}{dt} = \frac 1b Q$, then $f-a$ is a solution to your equation, therefore is suffices to only look at $a=0$.

The chain rule can be used to see, that if $f$ solves $\frac{dQ}{dt} = Q$, then $f(t/b)$ solves $\frac{dQ}{dt} = \frac 1b Q$.

Therefore all your solutions are of the form $C\exp(t/b) - a, C\in\mathbb{R}$.

Old Post:

I think these differential equations can be solved by "Separation of Variables". See the Wikipedia for a guide. It's got examples! =)

-
Hmm, I was looking more for a guide I could follow and understand on equations that were in this specific form with an explanation of each step. But thanks for the link, I'll take a look. – Sam152 Sep 14 '10 at 11:00
@Sam152: Another solution, way simpler now =) – Jens Sep 14 '10 at 12:42
Shouldn't be $f+a$ instead of $f-a$? Plus: I think your "newcommand" \R doesn't work here. You'll need the whole \mathbb{R}. :-) – a.r. Sep 14 '10 at 13:13
@Agusti: True, where can import my standard commands?! =) I checked again and still believe in $f-a$. Let f be as in the second paragraph, then $(f-a)' = f/b = ((f-a)+a)/b$. – Jens Sep 14 '10 at 13:27
Don't know how to import mine commands, or yours. It could be helpful, indeed. As for that sign: if I take $Q = f+a$ in your equation $\frac{dQ}{dt} = \frac{1}{b}Q$, I get Sam152's one, not with $Q=f-a$. Am I missing something? – a.r. Sep 14 '10 at 17:34