We are given:
\[
\frac{dy}{dx}=1+y^2.
\]
This equation can be separated as:
\[
\frac{dy}{1+y^2}=dx.
\]
Now integrate both sides:
\[
\int \frac{dy}{1+y^2}=\int dx.
\]
We know:
\[
\int \frac{dy}{1+y^2}=\tan^{-1}y.
\]
Also,
\[
\int dx=x+c.
\]
Therefore,
\[
\tan^{-1}y=x+c.
\]
Now take tangent on both sides:
\[
y=\tan(x+c).
\]
Hence, the solution is:
\[
y=\tan(x+c).
\]