30.6.16 problem 17

Internal problem ID [7551]
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 : 17
Date solved : Tuesday, September 30, 2025 at 04:47:14 PM
CAS classification : [_quadrature]

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