38.2.23 problem 23

Internal problem ID [6452]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Further problems 24. page 1068
Problem number : 23
Date solved : Wednesday, March 05, 2025 at 12:45:56 AM
CAS classification : [_Bernoulli]

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

Maple. Time used: 0.002 (sec). Leaf size: 25
ode:=2*diff(y(x),x)+y(x) = y(x)^3*(x-1); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {1}{\sqrt {{\mathrm e}^{x} c_1 +x}} \\ y &= -\frac {1}{\sqrt {{\mathrm e}^{x} c_1 +x}} \\ \end{align*}
Mathematica. Time used: 2.861 (sec). Leaf size: 40
ode=2*D[y[x],x]+y[x]==y[x]^3*(x-1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {1}{\sqrt {x+c_1 e^x}} \\ y(x)\to \frac {1}{\sqrt {x+c_1 e^x}} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.864 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((1 - x)*y(x)**3 + y(x) + 2*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {\frac {1}{C_{1} e^{x} + x}}, \ y{\left (x \right )} = \sqrt {\frac {1}{C_{1} e^{x} + x}}\right ] \]