\[ \boxed { \left ( x-a \right ) \left ( x-b \right ) {\frac {\rm d}{{\rm d}x}}y \left ( x \right ) + \left ( y \left ( x \right ) \right ) ^{2}+k \left ( y \left ( x \right ) +x-a \right ) \left ( y \left ( x \right ) +x-b \right ) =0} \]
Mathematica: cpu = 0.260533 (sec), leaf count = 133 \[ \left \{\left \{y(x)\to \frac {1}{2} \sqrt {\frac {-a^2 k^2+2 a b k^2-b^2 k^2}{(k+1)^2}} \tan \left (\frac {(k+1) \sqrt {\frac {-a^2 k^2+2 a b k^2-b^2 k^2}{(k+1)^2}} (\log (x-b)-\log (x-a))}{2 (a-b)}+c_1\right )-\frac {-a k-b k+2 k x}{2 (k+1)}\right \}\right \} \]
Maple: cpu = 0.125 (sec), leaf count = 128 \[ \left \{ y \left ( x \right ) ={\frac {k}{k+1} \left ( {\frac {{\it \_C1} \, \left ( a-x \right ) ^{k}a}{{\it \_C1}\, \left ( a-x \right ) ^{k}+ \left ( b-x \right ) ^{k}}}-{\frac {{\it \_C1}\, \left ( a-x \right ) ^{k }x}{{\it \_C1}\, \left ( a-x \right ) ^{k}+ \left ( b-x \right ) ^{k}}}+{ \frac { \left ( b-x \right ) ^{k}b}{{\it \_C1}\, \left ( a-x \right ) ^{k} + \left ( b-x \right ) ^{k}}}-{\frac { \left ( b-x \right ) ^{k}x}{{\it \_C1}\, \left ( a-x \right ) ^{k}+ \left ( b-x \right ) ^{k}}} \right ) } \right \} \]