Solve this differential equation $(x^2+1)y' = xy$ $$\begin{align}
(x^2+1)\frac{dy}{dx} &= xy \\
\frac{1}{y}\frac{dy}{dx} &= \frac{x}{(x^2+1)} \\
\int \frac{1}{y} dy &= \int \frac{x}{(x^2+1)} dx \\
\ln(y) &= \frac{1}{2\ln(x^2+1)} + C \\
y &= e^{\frac{1}{2\ln(x^2+1)} + C}
\end{align}$$
When I integrated $\frac{x}{x^2+1}$, I tried to use u substitution by setting $u = x^2+1$ and $ du = \frac{1}{2}x$. 
The answer says $y = K\sqrt{x^2+1}$ and after combing through my work, I am not sure where I went wrong except possibly during the integration part and need some help, thanks

Your hunch is right. Indeed there is a mistake at integration step:
$$\int \frac{x}{(x^2+1)} dx =\dfrac{1}{2}\ln|x^2+1|+C$$
Might help memorizing:
$$\int \dfrac{f'(x)}{f(x)}dx = \ln |f(x)|+C$$
