# How would I integrate -y'/(y-3)y?

how would I integrate -y'/(y-3)y??

Related Calculus and Beyond Homework Help News on Phys.org
ShayanJ
Gold Member
If you want to integrate that w.r.t. x(which I think is the case),I should say you can't do it. That should be a differential equation but if you don't specify what is it equal to,then its not even a differential equation and you can do nothing with it.For example you may say -y'/(y-3)y=y'' or any other thing and then you should go for finding a method for solving it.

If you want to integrate that w.r.t. x(which I think is the case),I should say you can't do it. That should be a differential equation but if you don't specify what is it equal to,then its not even a differential equation and you can do nothing with it.For example you may say -y'/(y-3)y=y'' or any other thing and then you should go for finding a method for solving it.

Sorry, the diff. eq is dy/dx = y(3-y) maybe that will help!

ShayanJ
Gold Member
Oh...well...that isn't very hard.
You can multiply by dx and divide by y(3-y) to have in rhs and lhs,integrals w.r.t. x and y.Then complete the square in the denominator of the y integral and then set the square part of it equal to sin(t) for a change of variable which solves the differential equation!

Please show, on wolframathematica It is giving my a general logarithmic solution. Can I use the arctan formula for integrals? I am here now:
y'/[(3/2)^2-(y-(3/2))^2] = 1

Mark44
Mentor
A different approach than the one Shyan gave is to use partial fraction decomposition to break up the left side.

You have
$\frac{dy}{y(3 - y)} = dx$

You can write the left side as [A/y + B/(3 - y)]dy and then integrate that with respect to y.

ShayanJ
Gold Member
I vote for Mark's solution!
And that's the one giving you the logarithmic answer.

A different approach than the one Shyan gave is to use partial fraction decomposition to break up the left side.

You have
$\frac{dy}{y(3 - y)} = dx$

You can write the left side as [A/y + B/(3 - y)]dy and then integrate that with respect to y.
Hi Mark!
I think I've got it, I just have one quick question.
$$\frac{1}{3}∫ (\frac{dy}{y-3}-\frac{dy}{y}) = ∫ 2 dx → -\frac{1}{3} ln |3-y| + \frac{1}{3} ln |y| = 2x + C$$
why does the 3 and the y switch places? When solving for y at the end, I get $$\frac{-3e^{3(2x+C)}}{e^{3(2x+C)}-1}$$
unless the y and the 3 switch places in the natural log, which gives the correct answer of
$$\frac{3e^{3(2x+C)}}{e^{3(2x+C)}+ 1}$$

**THE 3(2x+C) are exponents
why do we change y-3 to 3-y??

Last edited by a moderator:
And btw, the diff eq was actually y' = 2y(3-y)

Mark44
Mentor
When I did the partial fractions business, I got this:
$$\frac{1}{y(3 - y)} = \frac{1/3}{y} + \frac{1/3}{3 - y}$$
The last fraction is the same as -(1/3)/(y - 3). If you integrate, you get 1/3 [ ln|y| - ln|y - 3|] = 1/3 * ln[|y/(y - 3)|]. Notice that |3 - y| = |y - 3|.

The factor of 2 that you show in the original differential equation will change dx to 2dx, so the integral of the right side changes from x + C to 2x + C.

When I did the partial fractions business, I got this:
$$\frac{1}{y(3 - y)} = \frac{1/3}{y} + \frac{1/3}{3 - y}$$
The last fraction is the same as -(1/3)/(y - 3). If you integrate, you get 1/3 [ ln|y| - ln|y - 3|] = 1/3 * ln[|y/(y - 3)|]. Notice that |3 - y| = |y - 3|.

The factor of 2 that you show in the original differential equation will change dx to 2dx, so the integral of the right side changes from x + C to 2x + C.

So when taking the base e of both sides, must I change |y-3| to |3-y|? Switching these signs gives me different answers when solving for y, are they both considered correct?

Mark44
Mentor
I think that you might have made a mistake when you exponentiated both sides (what you referred to as "taking the base e of both sides").

After I integrate, I get 1/3 * [ln|y| - ln|y - 3|] = 2x + C, or [ln|y| - ln|y - 3|] = 6x + C'. That's the same as ln[|y|/|y - 3|] = 6x + C'.

Without an initial condition, you can't get rid of the absolute values. Is there an initial condition that you haven't shown us?
Since

I think that you might have made a mistake when you exponentiated both sides (what you referred to as "taking the base e of both sides").

After I integrate, I get 1/3 * [ln|y| - ln|y - 3|] = 2x + C, or [ln|y| - ln|y - 3|] = 6x + C'. That's the same as ln[|y|/|y - 3|] = 6x + C'.

Without an initial condition, you can't get rid of the absolute values. Is there an initial condition that you haven't shown us?
Since
The initial DE is $$\frac{dy}{dx} = 2y(y-3)$$
After integrating I get
$$-ln|y-3|+ln|y| = 3(2x+C)$$
then after exponentiation I get..
$$\frac{y}{y-3} = e^(3(2x+C))$$
$$\frac{y-3}{y} = \frac{1}{e^(3(2x+C))}$$
$$-\frac{3}{y} = \frac{1}{e^(3(2x+C))} -1$$
$$-\frac{3}{y} = \frac{1-e^(3(2x+C))}{e^(3(2x+C))}$$
$$y = -\frac{3e^(3(2x+C))}{1-e^(3(2x+C))}$$

But, via. the link provided, the solution is $$\frac{3e^(3(2x+C))}{e^(3(2x+C))+1}$$
since $$|y-3|$$ was changed to $$|3-y|$$
Are both solutions correct?
*the 3(2x+C)'s are exponents

Mark44
Mentor
The initial DE is $$\frac{dy}{dx} = 2y(y-3)$$
After integrating I get
$$-ln|y-3|+ln|y| = 3(2x+C)$$
then after exponentiation I get..
$$\frac{y}{y-3} = e^(3(2x+C))$$
Two things:
1. Where did the absolute values go? As already mentioned, if there is an initial condition, you might be able to get rid of them, but you don't show an initial condition. Are you making an assumption that y(x) and y(x) - 3 are both positive?
2. In LaTeX, put exponents inside braces - {}.
The expression on the right side should be written as e^{3(2x+C)} to make it render correctly. Also, instead of writing 3(2x + C), you can write 6x + C', where C' = 2C.
Writing the right side as $e^{6x + C'}$ allows you to write it as e6x * eC' = Ae6x, where A = eC' = e2C.
$$\frac{y-3}{y} = \frac{1}{e^(3(2x+C))}$$
$$-\frac{3}{y} = \frac{1}{e^(3(2x+C))} -1$$
$$-\frac{3}{y} = \frac{1-e^(3(2x+C))}{e^(3(2x+C))}$$
$$y = -\frac{3e^(3(2x+C))}{1-e^(3(2x+C))}$$

But, via. the link provided, the solution is $$\frac{3e^(3(2x+C))}{e^(3(2x+C))+1}$$
since $$|y-3|$$ was changed to $$|3-y|$$
|y - 3| and |3 - y| are identically equal, so you can change one for the other. The bigger question is what happened to the absolute values in the first place?
Are both solutions correct?
You can check to see. If they both satisfy the differential equation, they're both correct.
*the 3(2x+C)'s are exponents

Two things:
1. Where did the absolute values go? As already mentioned, if there is an initial condition, you might be able to get rid of them, but you don't show an initial condition. Are you making an assumption that y(x) and y(x) - 3 are both positive?

The question says "Let f be a function with f(0)=1 such that all points (x, y) on the graph of f satisfy the logistic differential equation $$\frac{dy}{dx} = 2y(3-y).$$"

Mark44
Mentor
With f(x) = y, f(0) = y(0) = 1, and 3 - y(0) = 2. Both expressions are positive, and if we assume that x is close to 0, then both y(x) and 3 - y(x) will be positive.

This allows us to remove the absolute values.

y/(y - 3) = Ae6x
$\Rightarrow$ (y - 3)/y = Be-6x

Use the initial condition (y(0) = 1) to solve for the constant B, and then solve for y in terms of x.