29.11.23 problem 314

Internal problem ID [4914]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 11
Problem number : 314
Date solved : Sunday, March 30, 2025 at 04:13:11 AM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 19
ode:=x*(1-x)*diff(y(x),x)+(2*x+1)*y(x) = a; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {3 \left (-1+x \right )^{3} c_1 +a}{3 x} \]
Mathematica. Time used: 0.038 (sec). Leaf size: 23
ode=x(1-x)D[y[x],x]+(1+2 x)y[x]==a; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {a-3 c_1 (x-1)^3}{3 x} \]
Sympy. Time used: 0.516 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(-a + x*(1 - x)*Derivative(y(x), x) + (2*x + 1)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} x^{2} - 3 C_{1} x + 3 C_{1} - \frac {C_{1}}{x} + \frac {a}{3 x} \]