30.6.31 problem 32

Internal problem ID [7566]
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 : 32
Date solved : Tuesday, September 30, 2025 at 04:53:09 PM
CAS classification : [[_homogeneous, `class A`], _rational, _Bernoulli]

\begin{align*} y^{\prime }&=\frac {x}{y}+\frac {y}{x} \end{align*}

With initial conditions

\begin{align*} y \left (1\right )&=-4 \\ \end{align*}
Maple. Time used: 0.028 (sec). Leaf size: 15
ode:=diff(y(x),x) = x/y(x)+y(x)/x; 
ic:=[y(1) = -4]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -\sqrt {2 \ln \left (x \right )+16}\, x \]
Mathematica. Time used: 0.117 (sec). Leaf size: 21
ode=D[y[x],x]== x/y[x]+y[x]/x; 
ic={y[1]==-4}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\sqrt {2} x \sqrt {\log (x)+8} \end{align*}
Sympy. Time used: 0.191 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x/y(x) + Derivative(y(x), x) - y(x)/x,0) 
ics = {y(1): -4} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - x \sqrt {2 \log {\left (x \right )} + 16} \]