4.2.9 problem 9

Internal problem ID [1137]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Section 2.2. Page 48
Problem number : 9
Date solved : Tuesday, September 30, 2025 at 04:23:30 AM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (0\right )&=-{\frac {1}{6}} \\ \end{align*}
Maple. Time used: 0.108 (sec). Leaf size: 14
ode:=diff(y(x),x) = (1-2*x)*y(x)^2; 
ic:=[y(0) = -1/6]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {1}{x^{2}-x -6} \]
Mathematica. Time used: 0.093 (sec). Leaf size: 15
ode=D[y[x],x] == (1-2*x)*y[x]^2; 
ic=y[0]==-1/6; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{x^2-x-6} \end{align*}
Sympy. Time used: 0.109 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((2*x - 1)*y(x)**2 + Derivative(y(x), x),0) 
ics = {y(0): -1/6} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {1}{x^{2} - x - 6} \]