Solve this ordinary differential equation for H

ordinary differential equations

Now I'm building a differential equation model in social science, but I'm not familiar with how to solve.

My model is below:

$$\frac{dH_t}{dt} = a\left(\frac{H_t}{H_t+b} -p\right) $$

I want to solve for $H_t$ (I also need the answer when $t=0, H_0$).

$a,b,p$ are constant.

Could someone solve this equation?
Thank you in advance for your time and help.

Best Answer

Well, first of all we have:

$$\mathcal{H}'\left(t\right)=\text{a}\cdot\left\{\frac{\mathcal{H}\left(t\right)}{\mathcal{H}\left(t\right)+\text{b}}-\text{p}\right\}\tag1$$

We can write (by dividing both sides by $\frac{\mathcal{H}\left(t\right)}{\mathcal{H}\left(t\right)+\text{b}}-\text{p}$):

$$\frac{\mathcal{H}'\left(t\right)}{\frac{\mathcal{H}\left(t\right)}{\mathcal{H}\left(t\right)+\text{b}}-\text{p}}=\text{a}\space\Longrightarrow\space\int\frac{\mathcal{H}'\left(t\right)}{\frac{\mathcal{H}\left(t\right)}{\mathcal{H}\left(t\right)+\text{b}}-\text{p}}\space\text{d}t=\int\text{a}\space\text{d}t\tag2$$

Which gives for the RHS:

$$\int\text{a}\space\text{d}t=\text{a}\cdot t+\text{K}_1\tag3$$

And for the LHS, we substitute $\text{u}=\mathcal{H}\left(t\right)$:

$$\int\frac{\mathcal{H}'\left(t\right)}{\frac{\mathcal{H}\left(t\right)}{\mathcal{H}\left(t\right)+\text{b}}-\text{p}}\space\text{d}t=\int\frac{1}{\frac{\text{u}}{\text{u}+\text{b}}-\text{p}}\space\text{d}\text{u}\tag4$$

Now, for the integral we get:

$$\int\frac{1}{\frac{\text{u}}{\text{u}+\text{b}}-\text{p}}\space\text{d}\text{u}=\frac{\text{b}\cdot\ln\left|\text{b}\cdot\text{p}+\text{u}\cdot\left(\text{p}-1\right)\right|}{\left(\text{p}-1\right)^2}-\frac{\text{u}}{\text{p}-1}+\text{K}_2\tag5$$

So, in the end we have:

$$\frac{\text{b}\cdot\ln\left|\text{b}\cdot\text{p}+\mathcal{H}\left(t\right)\cdot\left(\text{p}-1\right)\right|}{\left(\text{p}-1\right)^2}-\frac{\mathcal{H}\left(t\right)}{\text{p}-1}=\text{a}\cdot t+\text{K}\tag6$$