I would need some help in solving the following differential equation: \begin{equation} u'(p) + \frac{r+ N \lambda p }{N\lambda p (1-p)} u(p) = \frac{r + N \lambda p}{N\lambda (1-p)} g. \end{equation}
I already know that the solution is of the form \begin{equation} gp + C(1-p)\left(\frac{1-p}{p}\right)^{r/\lambda N}, \end{equation} where $C$ is a constant.
Now this is a standard linear first-order differential equation. Letting $$ f(p) = \frac{r+ N \lambda p }{N\lambda p (1-p)}, \ \ q(p) = \frac{r + N \lambda p}{N\lambda (1-p)} g, \ \ \mu(p) = e^{\int f(p) dp}, $$ the solution should have the form \begin{equation} u(p) = \frac{C}{\mu(p)} + \frac{1}{\mu(p)} \int \mu(p) q(p) dp, \end{equation} where $C$ is a constant.
The calculation of $\mu(p)$ was not much of a problem. Indeed, we can rewrite $f(p)$ as $$ f(p) = \frac{r}{N\lambda} \frac{1}{p} + \left(1+ \frac{r}{N\lambda}\right)\frac{1}{1-p} $$ Using $\int \frac{1}{p} dp = \ln(p)$ and $\int \frac{1}{1-p} dp = - \ln (1-p)$, I found that $$ \mu(p) = p^{\frac{r}{N\lambda}}(1-p)^{-1-\frac{r}{N\lambda}}. $$ Where I have difficulties is calculating the term $\int \mu(p) q(p) dp$, where $$ \mu(p) q(p) = \frac{rg}{N\lambda} p^{\frac{r}{N\lambda}} (1-p)^{-2-\frac{r}{N\lambda}} + p^{\frac{r}{N\lambda}+1} (1-p)^{-2-\frac{r}{N\lambda}}. $$
How do I integrate this last term? Or did I miss something obvious, because in the paper I'm looking at they don't provide any details about how they get to the solution of the differential equation.
Thanks in advance for the help.
Edit: small typo corrected in the last displayed equation.
Edit: there is a big typo in the differential equation: the rhs should have $r + N \lambda $ rather than $r + N\lambda p$ in the numerator. This probably makes it much simpler to solve. My bad.
After the OP corrected the typo, the PDE becomes easy to solve.
$$u'(p) + \frac{r+ N \lambda p }{N\lambda p (1-p)} u(p) = \frac{r + N \lambda }{N\lambda (1-p)} g$$ $a=\frac{r}{N\lambda}$
$$u'(p) + \frac{a+ p }{ p (1-p)} u(p) = \frac{a + 1 }{ (1-p)} g$$
An obvious particular solution is $u=gp$. Thus, change of function : $u(p)=v(p)+gp$ $$v'+g + \frac{a+ p }{ p (1-p)} (v+gp) = \frac{a + 1 }{ (1-p)} g$$ After simplification : $$v'+\frac{a+ p }{ p (1-p)}v=0$$ Separable ODE easy to solve : $$v=C \frac{(1-p)^{1+a}}{p^a}$$ $$u=gp+C \frac{(1-p)^{1+a}}{p^a}$$