dp/dt = t ² p - p + t ² - 1
Factorize the right side:
dp/dt = p (t ² - 1) + (t ² - 1)
dp/dt = (p + 1) (t ² - 1)
So the differential equation is separable as
dp/(p + 1) = (t ² - 1) dt
Integrate both sides:
∫ dp/(p + 1) = ∫ (t ² - 1) dt
ln|p + 1| = t ³/3 - t + C
Solve for p :
p + 1 = exp(t ³/3 - t + C )
p + 1 = C exp(t ³/3 - t )
p = C exp(t ³/3 - t ) - 1