# Homework Help: Integrating dx/dt=k(a-x)(b-x)

1. Aug 23, 2013

### jhast1

1. The problem statement, all variables and given/known data

I need to integrate dx/dt=k(a-x)(b-x) and then rearrange to find x

3. The attempt at a solution

1/((a-x)(b-x))dx = k dt

Integrating dx using partial fractions:
1/(b-a)×(ln((a-x)/(b-x))=kt+c

when t=0 x=0
∴c=(ln(a/b))/(b-a)

then when I rearrange I get:
x=(e^((b-a)(kt+c))×(a-b))/((e^((b-a)(kt+c))-1)

Then I change the x to y and t to x so that I can graph it, but it doesn't give me the curve that I want, I have attached the graph. I am was assuming that it would give something like the black curve rather than the red one that it gave. Am I doing something wrong?

Last edited: Aug 28, 2013
2. Aug 24, 2013

### davidchen9568

What are the values of a,b, and k?

3. Aug 24, 2013

### jhast1

positive integers

4. Aug 24, 2013

### Electric Red

Hey jhast1,

I tried solving your equation, and when you say
"Integrating dx using partial fractions: 1/(b-a)×(ln((a-x)/(b-x))=kt+c"

I've got something which looks more like:

$\frac{ln(x-a)-ln(x-b)}{(a-b)}=kt$

But maybe I just made a mistake..

5. Aug 24, 2013

### jhast1

Here is my working.

Last edited: Aug 28, 2013
6. Aug 24, 2013

### CAF123

This is nearly correct, but you have the argument of the log flipped. From looking at your attached work, it appears you integrated dx/(a-x) and dx/(b-x) incorrectly and this will be the source of your error.

Your work assumes a≠b and this is not stated, however, given the set up of the question (i.e it is not written as k(a-x)2) then I suppose you can assume this is not the case. Were there any conditions on a and b given after the question?

7. Aug 24, 2013

### jhast1

ok so I did that part again and i got:
ln((b-x)/(a-x))/(b-a)=kt+b

Then I made x the subject and got this but I'm still not sure if it is right.

x=(e(b-a)(kt+c)-b)/(-e((b-a)(kt+c))-1)

where c=ln(a/b)/(b-a)

Edit: a and b are not equal

Last edited: Aug 24, 2013
8. Aug 24, 2013

### davidchen9568

Looks like I get $$x=\frac { a{ e }^{ r }-b }{ { e }^{ r }-1 } \\ r=(b-a)(kt+c)$$

9. Aug 24, 2013

### CAF123

Where is this initial condition specified?

I think there are two small errors above - you missed a coefficient in front of the exp term and there is a stray minus.

10. Aug 24, 2013

### davidchen9568

In the original post. t=0 when x=0.

11. Aug 24, 2013

### jhast1

The conditions are given in the question I have:
a is the amount of substance A and b is the amount of substance B, at t=0. x is the amount of product that these substances have produced at time t.

I see where I missed those things, however this does still not give me the curve that I'm expecting. Unless it's supposed to give me this curve.

12. Aug 24, 2013

### CAF123

The statement 't=0 when x=0' appeared in the attempt at a solution section. Since it did not appear in the Problem statement section, I wondered where that initial condition came from.

13. Aug 24, 2013

### haruspex

I think you have a sign wrong.
Shouldn't that be c=ln(b/a)/(b-a)? Substituting that in the (corrected) previous equation allows a lot of simplification.
Btw, a check you can do on the answer is to let b tend to a and see if you get the right answer for the case b = a.

14. Aug 24, 2013

### ehild

it should be 1/(a-b)×(ln((a-x)/(b-x))=kt+c

ehild