76.5.30 problem 31

Internal problem ID [17379]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 2. First order differential equations. Section 2.7 (Substitution Methods). Problems at page 108
Problem number : 31
Date solved : Monday, March 31, 2025 at 04:10:34 PM
CAS classification : [_exact, _Bernoulli]

\begin{align*} 2 x y y^{\prime }+\ln \left (x \right )&=-y^{2}-1 \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 42
ode:=2*x*y(x)*diff(y(x),x)+ln(x) = -y(x)^2-1; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {\sqrt {-x \left (x \ln \left (x \right )-c_1 \right )}}{x} \\ y &= -\frac {\sqrt {-x \left (x \ln \left (x \right )-c_1 \right )}}{x} \\ \end{align*}
Mathematica. Time used: 0.217 (sec). Leaf size: 46
ode=2*x*y[x]*D[y[x],x]+Log[x]==-y[x]^2-1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {\sqrt {-x \log (x)+c_1}}{\sqrt {x}} \\ y(x)\to \frac {\sqrt {-x \log (x)+c_1}}{\sqrt {x}} \\ \end{align*}
Sympy. Time used: 0.469 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*y(x)*Derivative(y(x), x) + y(x)**2 + log(x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {\frac {C_{1}}{x} - \log {\left (x \right )}}, \ y{\left (x \right )} = \sqrt {\frac {C_{1}}{x} - \log {\left (x \right )}}\right ] \]