##### 4.2.20 $$y'(x)=a x^m+b x^n y(x)^2$$

ODE
$y'(x)=a x^m+b x^n y(x)^2$ ODE Classiﬁcation

[_Riccati]

Book solution method
Riccati ODE, Generalized ODE

Mathematica
cpu = 0.379511 (sec), leaf count = 1067

$\left \{\left \{y(x)\to -\frac {a^{-\frac {n+1}{2 (m+n+2)}} b^{-\frac {2 m+3 n+5}{2 (m+n+2)}} (m+n+1)^{\frac {n+1}{m+n+2}} \left ((m+n+1)^2\right )^{\frac {n+1}{m+n+2}-\frac {1}{2}} x^{-n-1} \left (x^{m+n+1}\right )^{-\frac {n+1}{2 (m+n+1)}} \left (a^{\frac {n+1}{2 (m+n+2)}} b^{\frac {n+1}{2 (m+n+2)}} (m+n+1)^{-\frac {n+1}{m+n+2}} (m+n+2) \left (-\sqrt {a} \sqrt {b} (m+n+1) J_{\frac {m+1}{m+n+2}}\left (\frac {2 \sqrt {a} \sqrt {b} (m+n+1) \left (x^{m+n+1}\right )^{\frac {1}{2} \left (1+\frac {1}{m+n+1}\right )}}{\sqrt {(m+n+1)^2} (m+n+2)}\right ) \left (x^{m+n+1}\right )^{\frac {1}{2} \left (1+\frac {1}{m+n+1}\right )}+\sqrt {a} \sqrt {b} (m+n+1) J_{-\frac {m+2 n+3}{m+n+2}}\left (\frac {2 \sqrt {a} \sqrt {b} (m+n+1) \left (x^{m+n+1}\right )^{\frac {1}{2} \left (1+\frac {1}{m+n+1}\right )}}{\sqrt {(m+n+1)^2} (m+n+2)}\right ) \left (x^{m+n+1}\right )^{\frac {1}{2} \left (1+\frac {1}{m+n+1}\right )}+(n+1) \sqrt {(m+n+1)^2} J_{-\frac {n+1}{m+n+2}}\left (\frac {2 \sqrt {a} \sqrt {b} (m+n+1) \left (x^{m+n+1}\right )^{\frac {1}{2} \left (1+\frac {1}{m+n+1}\right )}}{\sqrt {(m+n+1)^2} (m+n+2)}\right )\right ) c_1 \Gamma \left (\frac {m+1}{m+n+2}\right ) \left (x^{m+n+1}\right )^{\frac {n+1}{2 (m+n+1)}}+a^{\frac {n+1}{2 (m+n+2)}} b^{\frac {n+1}{2 (m+n+2)}} (n+1)^2 (m+n+1)^{\frac {n+1}{m+n+2}} \left ((m+n+1)^2\right )^{\frac {m-n}{2 (m+n+2)}} J_{\frac {n+1}{m+n+2}}\left (\frac {2 \sqrt {a} \sqrt {b} (m+n+1) \left (x^{m+n+1}\right )^{\frac {1}{2} \left (1+\frac {1}{m+n+1}\right )}}{\sqrt {(m+n+1)^2} (m+n+2)}\right ) \Gamma \left (\frac {n+1}{m+n+2}\right ) \left (x^{m+n+1}\right )^{\frac {n+1}{2 (m+n+1)}}+a^{\frac {m+2 n+3}{2 (m+n+2)}} b^{\frac {m+2 n+3}{2 (m+n+2)}} (n+1) (m+n+1)^{\frac {m+2 n+3}{m+n+2}} \left ((m+n+1)^2\right )^{-\frac {n+1}{m+n+2}} \left (J_{-\frac {m+1}{m+n+2}}\left (\frac {2 \sqrt {a} \sqrt {b} (m+n+1) \left (x^{m+n+1}\right )^{\frac {1}{2} \left (1+\frac {1}{m+n+1}\right )}}{\sqrt {(m+n+1)^2} (m+n+2)}\right )-J_{\frac {n+1}{m+n+2}+1}\left (\frac {2 \sqrt {a} \sqrt {b} (m+n+1) \left (x^{m+n+1}\right )^{\frac {1}{2} \left (1+\frac {1}{m+n+1}\right )}}{\sqrt {(m+n+1)^2} (m+n+2)}\right )\right ) \Gamma \left (\frac {n+1}{m+n+2}\right ) \left (x^{m+n+1}\right )^{\frac {m+2 n+3}{2 (m+n+1)}}\right )}{2 \left ((m+n+2) J_{-\frac {n+1}{m+n+2}}\left (\frac {2 \sqrt {a} \sqrt {b} (m+n+1) \left (x^{m+n+1}\right )^{\frac {1}{2} \left (1+\frac {1}{m+n+1}\right )}}{\sqrt {(m+n+1)^2} (m+n+2)}\right ) c_1 \Gamma \left (\frac {m+1}{m+n+2}\right ) \left ((m+n+1)^2\right )^{\frac {n+1}{m+n+2}}+(n+1) (m+n+1)^{\frac {2 (n+1)}{m+n+2}} J_{\frac {n+1}{m+n+2}}\left (\frac {2 \sqrt {a} \sqrt {b} (m+n+1) \left (x^{m+n+1}\right )^{\frac {1}{2} \left (1+\frac {1}{m+n+1}\right )}}{\sqrt {(m+n+1)^2} (m+n+2)}\right ) \Gamma \left (\frac {n+1}{m+n+2}\right )\right )}\right \}\right \}$

Maple
cpu = 0.224 (sec), leaf count = 177

$\left [y \left (x \right ) = \frac {\left (\BesselY \left (\frac {m +1}{m +n +2}, \frac {2 \sqrt {a b}\, x^{\frac {m}{2}+\frac {n}{2}+1}}{m +n +2}\right ) \textit {\_C1} +\BesselJ \left (\frac {m +1}{m +n +2}, \frac {2 \sqrt {a b}\, x^{\frac {m}{2}+\frac {n}{2}+1}}{m +n +2}\right )\right ) x^{\frac {m}{2}+\frac {n}{2}+1} \sqrt {a b}\, x^{-n}}{\left (\BesselY \left (-\frac {n +1}{m +n +2}, \frac {2 \sqrt {a b}\, x^{\frac {m}{2}+\frac {n}{2}+1}}{m +n +2}\right ) \textit {\_C1} +\BesselJ \left (-\frac {n +1}{m +n +2}, \frac {2 \sqrt {a b}\, x^{\frac {m}{2}+\frac {n}{2}+1}}{m +n +2}\right )\right ) b x}\right ]$ Mathematica raw input

DSolve[y'[x] == a*x^m + b*x^n*y[x]^2,y[x],x]

Mathematica raw output

{{y[x] -> -1/2*((1 + m + n)^((1 + n)/(2 + m + n))*((1 + m + n)^2)^(-1/2 + (1 + n
)/(2 + m + n))*x^(-1 - n)*((a^((1 + n)/(2*(2 + m + n)))*b^((1 + n)/(2*(2 + m + n
)))*(2 + m + n)*(x^(1 + m + n))^((1 + n)/(2*(1 + m + n)))*(-(Sqrt[a]*Sqrt[b]*(1
+ m + n)*(x^(1 + m + n))^((1 + (1 + m + n)^(-1))/2)*BesselJ[(1 + m)/(2 + m + n),
 (2*Sqrt[a]*Sqrt[b]*(1 + m + n)*(x^(1 + m + n))^((1 + (1 + m + n)^(-1))/2))/(Sqr
t[(1 + m + n)^2]*(2 + m + n))]) + (1 + n)*Sqrt[(1 + m + n)^2]*BesselJ[-((1 + n)/
(2 + m + n)), (2*Sqrt[a]*Sqrt[b]*(1 + m + n)*(x^(1 + m + n))^((1 + (1 + m + n)^(
-1))/2))/(Sqrt[(1 + m + n)^2]*(2 + m + n))] + Sqrt[a]*Sqrt[b]*(1 + m + n)*(x^(1
+ m + n))^((1 + (1 + m + n)^(-1))/2)*BesselJ[-((3 + m + 2*n)/(2 + m + n)), (2*Sq
rt[a]*Sqrt[b]*(1 + m + n)*(x^(1 + m + n))^((1 + (1 + m + n)^(-1))/2))/(Sqrt[(1 +
 m + n)^2]*(2 + m + n))])*C[1]*Gamma[(1 + m)/(2 + m + n)])/(1 + m + n)^((1 + n)/
(2 + m + n)) + a^((1 + n)/(2*(2 + m + n)))*b^((1 + n)/(2*(2 + m + n)))*(1 + n)^2
*(1 + m + n)^((1 + n)/(2 + m + n))*((1 + m + n)^2)^((m - n)/(2*(2 + m + n)))*(x^
(1 + m + n))^((1 + n)/(2*(1 + m + n)))*BesselJ[(1 + n)/(2 + m + n), (2*Sqrt[a]*S
qrt[b]*(1 + m + n)*(x^(1 + m + n))^((1 + (1 + m + n)^(-1))/2))/(Sqrt[(1 + m + n)
^2]*(2 + m + n))]*Gamma[(1 + n)/(2 + m + n)] + (a^((3 + m + 2*n)/(2*(2 + m + n))
)*b^((3 + m + 2*n)/(2*(2 + m + n)))*(1 + n)*(1 + m + n)^((3 + m + 2*n)/(2 + m +
n))*(x^(1 + m + n))^((3 + m + 2*n)/(2*(1 + m + n)))*(BesselJ[-((1 + m)/(2 + m +
n)), (2*Sqrt[a]*Sqrt[b]*(1 + m + n)*(x^(1 + m + n))^((1 + (1 + m + n)^(-1))/2))/
(Sqrt[(1 + m + n)^2]*(2 + m + n))] - BesselJ[1 + (1 + n)/(2 + m + n), (2*Sqrt[a]
*Sqrt[b]*(1 + m + n)*(x^(1 + m + n))^((1 + (1 + m + n)^(-1))/2))/(Sqrt[(1 + m +
n)^2]*(2 + m + n))])*Gamma[(1 + n)/(2 + m + n)])/((1 + m + n)^2)^((1 + n)/(2 + m
 + n))))/(a^((1 + n)/(2*(2 + m + n)))*b^((5 + 2*m + 3*n)/(2*(2 + m + n)))*(x^(1
+ m + n))^((1 + n)/(2*(1 + m + n)))*(((1 + m + n)^2)^((1 + n)/(2 + m + n))*(2 +
m + n)*BesselJ[-((1 + n)/(2 + m + n)), (2*Sqrt[a]*Sqrt[b]*(1 + m + n)*(x^(1 + m
+ n))^((1 + (1 + m + n)^(-1))/2))/(Sqrt[(1 + m + n)^2]*(2 + m + n))]*C[1]*Gamma[
(1 + m)/(2 + m + n)] + (1 + n)*(1 + m + n)^((2*(1 + n))/(2 + m + n))*BesselJ[(1
+ n)/(2 + m + n), (2*Sqrt[a]*Sqrt[b]*(1 + m + n)*(x^(1 + m + n))^((1 + (1 + m +
n)^(-1))/2))/(Sqrt[(1 + m + n)^2]*(2 + m + n))]*Gamma[(1 + n)/(2 + m + n)]))}}

Maple raw input

dsolve(diff(y(x),x) = a*x^m+b*x^n*y(x)^2, y(x))

Maple raw output

[y(x) = (BesselY((m+1)/(m+n+2),2*(a*b)^(1/2)*x^(1/2*m+1/2*n+1)/(m+n+2))*_C1+Bess
elJ((m+1)/(m+n+2),2*(a*b)^(1/2)*x^(1/2*m+1/2*n+1)/(m+n+2)))*x^(1/2*m+1/2*n+1)*(a
*b)^(1/2)/(BesselY(-(n+1)/(m+n+2),2*(a*b)^(1/2)*x^(1/2*m+1/2*n+1)/(m+n+2))*_C1+B
esselJ(-(n+1)/(m+n+2),2*(a*b)^(1/2)*x^(1/2*m+1/2*n+1)/(m+n+2)))*x^(-n)/b/x]