29.12.5 problem 324

Internal problem ID [4924]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 12
Problem number : 324
Date solved : Sunday, March 30, 2025 at 04:14:57 AM
CAS classification : [_separable]

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

Maple. Time used: 0.002 (sec). Leaf size: 37
ode:=(x-a)*(x-b)*diff(y(x),x) = c*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {a -b}{-c \ln \left (x -a \right )+c \ln \left (x -b \right )+\left (a -b \right ) c_1} \]
Mathematica. Time used: 0.445 (sec). Leaf size: 44
ode=(x-a)(x-b)D[y[x],x]==c y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {b-a}{c_1 (a-b)+c \log (x-a)-c \log (x-b)} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.482 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
y = Function("y") 
ode = Eq(-c*y(x)**2 + (-a + x)*(-b + x)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {- a + b}{C_{1} a - C_{1} b + c \log {\left (- a + x \right )} - c \log {\left (- b + x \right )}} \]