Answer
\[y(x)=6\large e^{\Large\frac{x^3}{3}}-1\]
Work Step by Step
$y'-x^2y=x^2$ ____(1)
(1) is Linear differential equation
Integrating Factor:-
\[I(x)=e^{-\int x^2 dx}=e^{-\frac{x^3}{3}}\]
Multiply (1) by $I(x)$
\[e^{-\frac{x^3}{3}}\frac{dy}{dx}-x^2e^{-\frac{x^3}{3}}y=x^2e^{-\frac{x^3}{3}}\]
\[\frac{d}{dx}(ye^{-\frac{x^3}{3}})=x^2e^{-\frac{x^3}{3}}\]
Integrating,
$ye^{-\frac{x^3}{3}}=\int x^2e^{-\frac{x^3}{3}}dx+C$ ___(2)
$C$ is constant of integration
Put $t=-\frac{x^3}{3}\Rightarrow dt=-x^2 dx$
(2) becomes
\[ye^{-\frac{x^3}{3}}=-\int e^t dt+C=-e^t+C\]
$ye^{-\frac{x^3}{3}}=-e^{-\frac{x^3}{3}}+C$ ____(3)
Using initial condition $y(0)=5$
$5=-1+C\Rightarrow C=6$
From (3)
$y(x)=6e^{\frac{x^3}{3}}-1$