The given first-order nonlinear ordinary differential equation is separable, so

$$

\frac{dy}{dx} = 2(1+x)(1+y^2) \Rightarrow \frac{dy}{1+y^2} = 2(1+x)dx \Rightarrow \arctan{y} = x^2 + 2x + C \Leftrightarrow y(x) = \tan{(x^2 + 2x + C)}.

$$

Using the initial condition, we find $C$:

$$

0 = \tan{(0^2 + 2(0) + C)} \Leftrightarrow C = \arctan{0} = 0

$$

Conclusively, the solution to the initial value problem is

$$

y(x) = \tan{(x^2 + 2x)}.

$$