# Homework Help: System of ODEs

1. Oct 13, 2011

### squenshl

1. The problem statement, all variables and given/known data
Consider the following system of equations
da/dt = -kab, db/dt = kab, a(0) = a0, b(0) = b0.

Solve these equations exactly.

2. Relevant equations

3. The attempt at a solution
I added them together to get d(a+b)/dt = 0 which implies a + b = a0 + b0.
Therefore a = a0 + b0 - b so eliminating a we get db/dt = k(a0 + b0 - b)b which is separable, but I don't know where to go from here.

2. Oct 13, 2011

### Staff: Mentor

So db/(a0 + b0 - b)b = k
$$\frac{db}{b(a_0 + b_0 - b)} = k\cdot dt$$

The left side can be integrated by using partial fraction decomposition. You could simplify the work slightly by rewriting a0 + b0 as, say, M.

3. Oct 13, 2011

### squenshl

Thanks.

I let M = a0 + b0 and got 1/(b(M-b)) = 1/(Mb) + 1/(M(M-b))
and this integrates to (ln(b)-ln(M-b))/M,
therefore we get (ln(b)-ln(M-b))/M = kt + c, so ln(b/(M-b)) = M(kt+c), so b/(M-b) = exp(M(kt+c) but what do I do now.

4. Oct 13, 2011

### Staff: Mentor

Then b = (M - b)exp(M(kt + c))
==> b - bexp(M(kt + c)) = Mexp(M(kt + c))
==> b(1 - exp(M(kt + c))) = Mexp(M(kt + c))
==> b = ?

You should be able to get rid of the constant c, since you are given that b(0) = b0.

Finally, since a and b add up to a constant, you can solve for a.

When you get a, by all means, check your work. Check that a(0) and b(0) turn out as expected, and then check that a'(t) = -kab, and that b'(t) = -a'(t).

5. Oct 13, 2011

### squenshl

We get b = Mexp(M(kt+c))/(1-exp(M(kt+c))
so b(0) = b0 = Mexp(Mc)/(1-exp(Mc)), but how do we find c?

6. Oct 13, 2011

### Staff: Mentor

b0(1 - exp(Mc)) = Mexp(Mc)
==> b0 - b0exp(Mc) = Mexp(Mc)
==> b0 = b0exp(Mc) + Mexp(Mc) = exp(Mc)(b0 +M)
==> b0/(b0 +M) = exp(Mc)

Now take the ln of both sides.