29.9.16 problem 256

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

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

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