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 Classification

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

Book solution method
Riccati ODE, Generalized ODE

Mathematica
cpu = 0.256415 (sec), leaf count = 102

\[\left \{\left \{y(x)\to \frac {(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 )+k (a+b-2 x)}{2 (k+1)}\right \}\right \}\]

Maple
cpu = 0.202 (sec), leaf count = 58

\[ \left \{ y \relax (x ) ={\frac { \left ({\it \_C1}\, \left (a-x \right ) \left (a-x \right ) ^{k}+ \left (b-x \right ) ^{k} \left (b-x \right ) \right ) k}{ \left (k+1 \right ) \left ({\it \_C1}\, \left (a-x \right ) ^{k}+ \left (b-x \right ) ^{k} \right ) }} \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) + Sqrt[-(((a - b)^2*k^2)/(1 + k)^2)]*(1 + k)*Tan[C[1]
 + (Sqrt[-(((a - b)^2*k^2)/(1 + k)^2)]*(1 + k)*(-Log[-a + x] + Log[-b + x]))/(2*
(a - b))])/(2*(1 + k))}}

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),'implicit')

Maple raw output

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