Solution:
Concept: A first-order equation is homogeneous when dxdy can be written as a function of xy, so we put y=vx; then dxdy=v+xdxdv, and the equation separates in v and x.
Step 1 — Make dxdy the subject.
We collect the dxdy terms on one side.
(xy−x2)dxdy=y2
dxdy=xy−x2y2
Dividing the top and bottom by x2 gives a function of xy, so the equation is homogeneous.
Step 2 — Substitute y=vx.
We replace dxdy by v+xdxdv and simplify.
v+xdxdv=v−1v2
xdxdv=v−1v2−v2+v
xdxdv=v−1v
Step 3 — Separate and integrate.
We multiply by vv−1 and divide by x, then integrate term by term.
(1−v1)dv=xdx
v−log∣v∣=log∣x∣+c
Step 4 — Combine the logs.
We move log∣v∣ to the right and use logA+logB=logAB; since vx=y, the log becomes log∣y∣.
v=log∣vx∣+c
xy=log∣y∣+c
y=x(c+log∣y∣)
Therefore, the general solution is y=x(c+log∣y∣), where c is an arbitrary constant.