ODE No. 51

\[ -h(x) (y(x)-f(x)) (y(x)-g(x)) \left (y(x)-\frac {a f(x)+b g(x)}{a+b}\right )-\frac {f'(x) (y(x)-g(x))}{f(x)-g(x)}-\frac {(y(x)-f(x)) g'(x)}{g(x)-f(x)}+y'(x)=0 \] Mathematica : cpu = 1.89443 (sec), leaf count = 355

DSolve[-(h[x]*(-f[x] + y[x])*(-g[x] + y[x])*(-((a*f[x] + b*g[x])/(a + b)) + y[x])) - ((-g[x] + y[x])*Derivative[1][f][x])/(f[x] - g[x]) - ((-f[x] + y[x])*Derivative[1][g][x])/(-f[x] + g[x]) + Derivative[1][y][x] == 0,y[x],x]
 

\[\text {Solve}\left [-\frac {1}{3} (a-b)^{2/3} (2 a+b)^{2/3} (a+2 b)^{2/3} \text {RootSum}\left [\text {$\#$1}^3 (a-b)^{2/3} (2 a+b)^{2/3} (a+2 b)^{2/3}-3 \text {$\#$1} a^2-3 \text {$\#$1} a b-3 \text {$\#$1} b^2+(a-b)^{2/3} (2 a+b)^{2/3} (a+2 b)^{2/3}\& ,\frac {\log \left (\frac {\frac {-2 a f(x) h(x)-a g(x) h(x)-b f(x) h(x)-2 b g(x) h(x)}{a+b}+3 h(x) y(x)}{\sqrt [3]{\frac {(f(x)-g(x))^3 \left (2 a^3 h(x)^3+3 a^2 b h(x)^3-3 a b^2 h(x)^3-2 b^3 h(x)^3\right )}{(a+b)^3}}}-\text {$\#$1}\right )}{-\text {$\#$1}^2 (a-b)^{2/3} (2 a+b)^{2/3} (a+2 b)^{2/3}+a^2+a b+b^2}\& \right ]=\int _1^x\frac {\left (\frac {(f(K[1])-g(K[1]))^3 \left (2 a^3 h(K[1])^3-2 b^3 h(K[1])^3-3 a b^2 h(K[1])^3+3 a^2 b h(K[1])^3\right )}{(a+b)^3}\right )^{2/3}}{9 h(K[1])}dK[1]+c_1,y(x)\right ]\] Maple : cpu = 0.382 (sec), leaf count = 237

dsolve(diff(y(x),x)-(y(x)-f(x))*(y(x)-g(x))*(y(x)-(a*f(x)+b*g(x))/(a+b))*h(x)-diff(f(x),x)*(y(x)-g(x))/(f(x)-g(x))-diff(g(x),x)*(y(x)-f(x))/(g(x)-f(x)) = 0,y(x))
 

\[y \left (x \right ) = \frac {2 \left (f \left (x \right )-g \left (x \right )\right ) \left (a +2 b \right ) \left (a -b \right ) \left (a +\frac {b}{2}\right ) \RootOf \left (-27 \left (\int _{}^{\textit {\_Z}}\frac {\left (a^{2}+a b +b^{2}\right )^{3}}{\left (2 \textit {\_a} \,a^{2}-\textit {\_a} a b -\textit {\_a} \,b^{2}-3 a^{2}-3 a b -3 b^{2}\right ) \left (\textit {\_a} \,a^{2}+\textit {\_a} a b -2 \textit {\_a} \,b^{2}+3 a^{2}+3 a b +3 b^{2}\right ) \left (2 \textit {\_a} \,a^{2}+5 \textit {\_a} a b +2 \textit {\_a} \,b^{2}-3 a^{2}-3 a b -3 b^{2}\right )}d \textit {\_a} \right )+\int \frac {\left (f \left (x \right )-g \left (x \right )\right )^{2} \left (a^{2}+a b +b^{2}\right ) h \left (x \right )}{3 \left (a +b \right )^{2}}d x +c_{1}\right )+6 \left (a^{2}+a b +b^{2}\right ) \left (\left (a +\frac {b}{2}\right ) f \left (x \right )+\frac {g \left (x \right ) \left (a +2 b \right )}{2}\right )}{9 a^{3}+18 a^{2} b +18 a \,b^{2}+9 b^{3}}\]