30.3.3 problem 3

Internal problem ID [7459]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.4, Exact equations. Exercises. page 64
Problem number : 3
Date solved : Tuesday, September 30, 2025 at 04:36:25 PM
CAS classification : [_separable]

\begin{align*} \sqrt {-2 y-y^{2}}+\left (-x^{2}+2 x +3\right ) y^{\prime }&=0 \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 21
ode:=(-2*y(x)-y(x)^2)^(1/2)+(-x^2+2*x+3)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -1+\sin \left (\frac {\ln \left (x -3\right )}{4}-\frac {\ln \left (x +1\right )}{4}+c_1 \right ) \]
Mathematica. Time used: 0.336 (sec). Leaf size: 54
ode=Sqrt[-2*y[x]-y[x]^2]+(3+2*x-x^2)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -2 \cos ^2\left (\frac {1}{2} \left (\int _1^x\frac {1}{K[1]^2-2 K[1]-3}dK[1]+c_1\right )\right )\\ y(x)&\to -2\\ y(x)&\to 0\\ y(x)&\to \text {Interval}[\{-2,0\}] \end{align*}
Sympy. Time used: 0.386 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(sqrt(-y(x)**2 - 2*y(x)) + (-x**2 + 2*x + 3)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \sin {\left (C_{1} + \frac {\log {\left (x - 3 \right )}}{4} - \frac {\log {\left (x + 1 \right )}}{4} \right )} - 1 \]