36.1.38 problem 32

Internal problem ID [6293]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.2, Separable Equations. Exercises. page 46
Problem number : 32
Date solved : Sunday, March 30, 2025 at 10:49:40 AM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=y^{2}-3 y+2 \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&={\frac {3}{2}} \end{align*}

Maple. Time used: 0.081 (sec). Leaf size: 15
ode:=diff(y(x),x) = y(x)^2-3*y(x)+2; 
ic:=y(0) = 3/2; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {2+{\mathrm e}^{x}}{{\mathrm e}^{x}+1} \]
Mathematica. Time used: 0.123 (sec). Leaf size: 18
ode=D[y[x],x]==y[x]^2-3*y[x]+2; 
ic={y[0]==3/2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^x+2}{e^x+1} \]
Sympy. Time used: 0.319 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x)**2 + 3*y(x) + Derivative(y(x), x) - 2,0) 
ics = {y(0): 3/2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {-1 - 2 e^{- x}}{-1 - e^{- x}} \]