36.3.3 problem 3

Internal problem ID [6324]
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 : Sunday, March 30, 2025 at 10:51:35 AM
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: 2.516 (sec). Leaf size: 99
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 \left (\frac {1}{4} (\log (3-x)-\log (x+1)+4 c_1)\right )-i \sqrt {3} \sin \left (\frac {1}{4} (\log (3-x)-\log (x+1)+4 c_1)\right )-1 \\ y(x)\to -2 \\ y(x)\to 0 \\ y(x)\to \text {Interval}[\{-3,1\}]+i \text {Interval}\left [\left \{-\sqrt {3},\sqrt {3}\right \}\right ] \\ \end{align*}
Sympy. Time used: 0.594 (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 \]