solve for y

**Answer 1**

By P2, do you mean P^2? By “solve for y”, do you mean “solve for P?” In this case, it’s just a breakable ODE:

dP/dt = P – P^2

1/(P – P^2)dP = dt

∫1/(P – P^2)dP = ∫dt

∫1/(P – P^2)dP = t + c, where c is a constant

To do the left integral, use the method of partial fractions. PP^2 factors for P(1-P), so we want to rewrite 1/(PP^2) as A/P+B/(1-P) for some constants A and B. So we have:

1/[P(1-P)] = A/P + B/(1-P)

A(1-P) + PA = 1

When P is 1, we have A(1-1)+B(1)=1, or B=1.

When P is 0, we have A(1-0)+B(0)=1, or A=1.

Thus, we can rewrite 1/(PP^2) as 1/P+1/(1-P).

By integrating the left side of the ODE, we have:

∫1/(P – P^2)dP

∫[1/P + 1/(1-P)]dP

∫(1/P)dP + ∫1/(1-P)dP

ln(P) + ∫1/(1-P)dP

To make the second integral, make a substitution u:

u = 1-P, du = -dP

ln(P) – ∫(1/u)du

ln(P) – ln(u)

ln(P) – ln(1-P)

in[P/(1-P)]

Plugging this back into the ODE, we have:

in[P/(1-P)] = t + c

e^ln[P/(1-P)] = e^(t + c)

P/(1-P) = e^t * e^c

P/(1-P) = ke^t, where k is a constant equal to e^c

P = (1-P)ke^t

P = ke^t – Pke^t

P + Pke^t = ke^t

P(1 + ke^t) = ke^t

P = ke^t / (1 + ke^t)

P = e^t/(1/k + e^t)

P = e^t / (d + e^t), where d is a constant equal to 1/k

So the general solution for ODE is P = e^t / (d + e^t), where d is a constant.

Edit:

@Paul, ln(PP^2) is not a primitive of 1/(PP^2).

Edit:

Who voted against my answer, do you want to explain why? I’m pretty sure I did everything right, but if I made a mistake, I’d like to know where.

**answer 2**

Do you mean to P?

dP/P(1 – P) = dt

Integration on both sides:

-ln|1 – P| + ln|P| = t + C

P/(1 – P) = Ce^