29.3.22 problem 76

Internal problem ID [4684]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 3
Problem number : 76
Date solved : Tuesday, March 04, 2025 at 07:02:44 PM
CAS classification : [_separable]

\begin{align*} y^{\prime }&=\left (a +b y+c y^{2}\right ) f \left (x \right ) \end{align*}

Maple. Time used: 0.056 (sec). Leaf size: 47
ode:=diff(y(x),x) = (a+b*y(x)+c*y(x)^2)*f(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {-b +\tan \left (\frac {\sqrt {4 a c -b^{2}}\, \left (\int f \left (x \right )d x +c_{1} \right )}{2}\right ) \sqrt {4 a c -b^{2}}}{2 c} \]
Mathematica. Time used: 0.281 (sec). Leaf size: 115
ode=D[y[x],x]==(a+b y[x]+c y[x]^2)f[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {-b+\sqrt {4 a c-b^2} \tan \left (\frac {1}{2} \sqrt {4 a c-b^2} \left (\int _1^xf(K[1])dK[1]+c_1\right )\right )}{2 c} \\ y(x)\to -\frac {\sqrt {b^2-4 a c}+b}{2 c} \\ y(x)\to \frac {\sqrt {b^2-4 a c}-b}{2 c} \\ \end{align*}
Sympy. Time used: 2.895 (sec). Leaf size: 134
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
y = Function("y") 
f = Function("f") 
ode = Eq((-a - b*y(x) - c*y(x)**2)*f(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \sqrt {- \frac {1}{4 a c - b^{2}}} \log {\left (y{\left (x \right )} + \frac {- 4 a c \sqrt {- \frac {1}{4 a c - b^{2}}} + b^{2} \sqrt {- \frac {1}{4 a c - b^{2}}} + b}{2 c} \right )} + \sqrt {- \frac {1}{4 a c - b^{2}}} \log {\left (y{\left (x \right )} + \frac {4 a c \sqrt {- \frac {1}{4 a c - b^{2}}} - b^{2} \sqrt {- \frac {1}{4 a c - b^{2}}} + b}{2 c} \right )} - \int f{\left (x \right )}\, dx = C_{1} \]