I was solving the following DE
$$\frac{y+x}{x}=y'$$
and my solution was
$$xdy = (y+x)dx$$
Letting $y=xv$ then $dy=xdv+vdx$ and so the above equation becomes
$$x^2dv + xvdx =xvdx+xdx$$
From here I get
$$x^2dv=xdx$$
Now here is where things get interesting. I can write this as $$\int 1 dv = \int \frac{1}{x}dx$$ And get the solution $$y=x\ln(x)+cx$$
But when I took my exam, I didn't do this.... instead I did this:
$$\int x^2dv = \int x dx$$ Which gives
$$x^2v=\frac{1}{2}x^2+C$$ $$xy=\frac{1}{2}x^2+c$$ $$y=\frac{1}{2}x+\frac{c}{x}$$
How can I reconcile these apparently different solutions?
Note that in the exam, you incorrectly wrote that $$ \int x^2\, dv = x^2 v $$ As $v$ depends on $x$, $x$ depends on $v$, so treating $x$ as a constant with respect ot $v$ is wrong.
That the second 'solution' is wrong can also be seen by just checking, we have for $y(x) := \frac 12x + \frac{c}x$ that $$ y'(x) = \frac 12 - \frac c{x^2} $$ and $$ \frac{y(x)+x}{x} = \frac{\frac 32x+\frac cx}x = \frac 32 + \frac c{x^2} \ne y'(x). $$