30.6.39 problem 40

Internal problem ID [7574]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Review problems. page 79
Problem number : 40
Date solved : Tuesday, September 30, 2025 at 04:54:22 PM
CAS classification : [_Bernoulli]

\begin{align*} y^{\prime }-4 y&=2 x y^{2} \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=-4 \\ \end{align*}
Maple. Time used: 0.019 (sec). Leaf size: 19
ode:=diff(y(x),x)-4*y(x) = 2*x*y(x)^2; 
ic:=[y(0) = -4]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -\frac {8}{3 \,{\mathrm e}^{-4 x}+4 x -1} \]
Mathematica. Time used: 0.089 (sec). Leaf size: 27
ode=D[y[x],x]-4*y[x]==2*x*y[x]^2; 
ic={y[0]==-4}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {8 e^{4 x}}{e^{4 x} (4 x-1)+3} \end{align*}
Sympy. Time used: 0.165 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x*y(x)**2 - 4*y(x) + Derivative(y(x), x),0) 
ics = {y(0): -4} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {8 e^{4 x}}{- 4 x e^{4 x} + e^{4 x} - 3} \]