Answer
$\displaystyle p=Ce^{\frac{t^3}{3}-t}-1$
Work Step by Step
$\displaystyle \frac{dp}{dt}=t^2p-p+t-p$
$\displaystyle \frac{dp}{dt}=p(t^2-1)+t-p$
$\displaystyle \frac{dp}{dt}=(p+1)(t^2-1)$
Separation of variables:
$\displaystyle \frac{dp}{p+1}=(t^2-1)dt$
Integrate both sides:
$\displaystyle \int\frac{dp}{p+1}=\int(t^2-1)dt$
$\displaystyle \ln|p+1|=\frac{t^3}{3}-t+C$
$\displaystyle p+1=e^{\frac{t^3}{3}-t+C}=Ce^{\frac{t^3}{3}-t}$
$\displaystyle p=Ce^{\frac{t^3}{3}-t}-1$
The reason why the constant of integration is brought down is that it hasn't taken on an initial value yet.