can someone help me figure out how this differential equation \begin{equation} y' = p(t)(1-y) \tag{1} \end{equation} gives the following solution? \begin{equation} y = 1 + \exp\left[-\int_0^tp(s)ds\right]\left(y(0)-1\right) \tag{2} \end{equation}
I tried integrating factors, but I end stuck at this step: \begin{equation} y = e^{-\int_0^tp(s)ds}\left(\int e^{\int p(t)dt}p(t)dt + C\right) \tag{3} \end{equation}.
What's next or how else can I solve it so that we end up with the solution of Eq. 2?
Thanks so much in advanced!
separable diff. eq. $$y'=p(t)(1-y)\\\frac {dy}{dt}=p(t)(1-y)\\\frac {dy}{1-y}=p(t)dt\\\int_0^t \frac {dy}{1-y} = \int_0^t p(t)dt\\-\ln(1-y)|_0^t=\int_0^t p(t)dt\\\ln(\frac {1-y_0}{1-y})=\int_0^t p(t)dt\\\ln(\frac {1-y}{1-y_0})=-\int_0^t p(t)dt\\\frac {1-y}{1-y_0}=exp(-\int_0^t p(t)dt)$$ hope it helps