##### 4.7.29 $$k (-a+y(x)+x) (-b+y(x)+x)+(x-a) (x-b) y'(x)+y(x)^2=0$$

ODE
$k (-a+y(x)+x) (-b+y(x)+x)+(x-a) (x-b) y'(x)+y(x)^2=0$ ODE Classiﬁcation

[_rational, [_1st_order, _with_symmetry_[F(x),G(x)]], _Riccati]

Book solution method
Riccati ODE, Generalized ODE

Mathematica
cpu = 0.656821 (sec), leaf count = 99

$\left \{\left \{y(x)\to \frac {1}{2} \left (\frac {k (a+b-2 x)}{k+1}+\sqrt {-\frac {k^2 (a-b)^2}{(k+1)^2}} \tan \left (\frac {(k+1) \sqrt {-\frac {k^2 (a-b)^2}{(k+1)^2}} (\log (x-b)-\log (x-a))}{2 (a-b)}+c_1\right )\right )\right \}\right \}$

Maple
cpu = 0.191 (sec), leaf count = 128

$\left [y \left (x \right ) = \frac {k \left (\frac {\left (a -x \right )^{k} \textit {\_C1} a}{\textit {\_C1} \left (a -x \right )^{k}+\left (b -x \right )^{k}}-\frac {\left (a -x \right )^{k} \textit {\_C1} x}{\textit {\_C1} \left (a -x \right )^{k}+\left (b -x \right )^{k}}+\frac {\left (b -x \right )^{k} b}{\textit {\_C1} \left (a -x \right )^{k}+\left (b -x \right )^{k}}-\frac {\left (b -x \right )^{k} x}{\textit {\_C1} \left (a -x \right )^{k}+\left (b -x \right )^{k}}\right )}{k +1}\right ]$ Mathematica raw input

DSolve[y[x]^2 + k*(-a + x + y[x])*(-b + x + y[x]) + (-a + x)*(-b + x)*y'[x] == 0,y[x],x]

Mathematica raw output

{{y[x] -> ((k*(a + b - 2*x))/(1 + k) + Sqrt[-(((a - b)^2*k^2)/(1 + k)^2)]*Tan[C[
1] + (Sqrt[-(((a - b)^2*k^2)/(1 + k)^2)]*(1 + k)*(-Log[-a + x] + Log[-b + x]))/(
2*(a - b))])/2}}

Maple raw input

dsolve((x-a)*(x-b)*diff(y(x),x)+k*(x+y(x)-a)*(x+y(x)-b)+y(x)^2 = 0, y(x))

Maple raw output

[y(x) = k/(k+1)*((a-x)^k/(_C1*(a-x)^k+(b-x)^k)*_C1*a-(a-x)^k/(_C1*(a-x)^k+(b-x)^
k)*_C1*x+(b-x)^k/(_C1*(a-x)^k+(b-x)^k)*b-(b-x)^k/(_C1*(a-x)^k+(b-x)^k)*x)]