Chemical kinetics of a reversible reaction I am having trouble with the following question:


  Consider the following reversible reaction in which the reaction is first order in both
  directions: $$\ce{[A] &lt;=&gt; [B]}$$ $k_\mathrm a$ is the rate constant for the forward reaction and $k_\mathrm b$ is the rate constant for the reverse reaction.
  
  If only reagent $\ce{A}$ is present at $t = 0$, such that $[\ce{A}](t = 0)$ = $[\ce{A}]_0$ (and likewise for $[\ce{B}]_0$), then at all subsequent times $[\ce{A}]+[\ce{B}] = [\ce{A}]_0$. Write down a differential equation for $\frac{\mathrm d[\ce{A}]}{\mathrm dt}$ where $[\ce{A}] \equiv [\ce{A}](t)$ is the concentration of the reagent $\ce{A}$, and hence show that:
  
  $$[\ce{A}]=[\ce{A}]_0\frac{k_\mathrm b+k_\mathrm a \exp[-(k_\mathrm a+k_\mathrm b)t]}{k_\mathrm a+k_\mathrm b}$$


Here's my attempt:

$$\frac{\mathrm d[\ce{A}]}{\mathrm dt}=-k_\mathrm a[\ce{A}]+k_\mathrm b[\ce{A}]\tag{1}$$

Then using the identity in the question: 

$$\frac{\mathrm d[\ce{A}]}{\mathrm dt}=-k_\mathrm a[\ce{A}]+k_\mathrm b([\ce{A}]_0-[\ce{A}])\tag{2}$$

Rearranging...

$$\frac{\mathrm d[\ce{A}]}{\mathrm dt}+(k_\mathrm a+k_\mathrm b)[\ce{A}]=k_\mathrm b[\ce{A}]_0\tag{3}$$

I believe that this is a first order linear differential equation with the integrating factor: $\mathrm e^{\int (k_\mathrm a+k_\mathrm b)\,\mathrm dt}=\mathrm e^{(k_\mathrm a+k_\mathrm b)t}$ Thus:

$$\frac{\mathrm d}{\mathrm dt}\left([\ce{A}]\mathrm e^{(k_\mathrm a+k_\mathrm b)t}\right)=k_\mathrm b[\ce{A}]_0\mathrm e^{(k_\mathrm a+k_\mathrm b)t}\tag{4}$$

$$[\ce{A}]\mathrm e^{(k_\mathrm a+k_\mathrm b)t}=\int k_\mathrm b[\ce{A}]_0\mathrm e^{(k_\mathrm a+k_\mathrm b)t}\,\mathrm dt\tag{5}$$

This gives me:

$$[\ce{A}]\mathrm e^{(k_\mathrm a+k_\mathrm b)t}=k_\mathrm b[\ce{A}]_0\frac{\mathrm e^{(k_\mathrm a+k_\mathrm b)t}}{k_\mathrm a+k_\mathrm b}+c\tag{6}$$

But this doesn't give me the final result if I put in the boundary conditions. Where have I gone wrong?
The simplest and most general way to solve this type of scheme is to calculate the effect of an amount x that reacts with initial amounts $A_0$ and $B_0$, thus
$$\ce{A~~~ &lt;=&gt;[k_a][k_b] ~~~B}  \\  A_0-x  ~~~~  B_0 +x $$
which produces the rate equation
$$ \frac{dx}{dt} = k_a(A_0-x)-k_b(B_0-x)$$

the variables can be split to give a straightforward integration instead of having to solve a complicated pair of differential equations.
$$\int _0^x \frac{dx}{k_aA_0-k_bB_0-(k_a+k_b)x} = \int _0^t dt$$

which, after some rearrangement, gives 
$$\ln\left(1-\frac{(k_a+k_b)}{k_aA_0-k_bB_0}\right) = -(k_a+k_b)t$$
and this can be rearranged to
$$x= \left( 1-e^{-(k_a+k_b)t}  \right)\frac{(k_aA_0-k_bB_0)}{k_a+k_b}$$

with the initial condition that at $t=0$, $B_0=\ce{[B]=0 }$ this becomes
$$x= \left( 1-e^{-(k_a+k_b)t}  \right)\frac{k_aA_0}{k_a+k_b}$$
The concentration of A is $A_0-x$ which is

$$ \ce{[A]}_t =A_0 \frac{k_b+k_ae^{-(k_a+k_b)t}}{k_a+k_b}$$

This expression has the correct form at all times. $\ce{[B]}_t$ can be calculated similarly from $B_0+x$.