47.2.19 problem 19

Internal problem ID [7435]
Book : Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section : Chapter 1. First order differential equations. Section 1.2 Homogeneous equations problems. page 12
Problem number : 19
Date solved : Sunday, March 30, 2025 at 12:04:00 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 )&=0 \end{align*}

Maple. Time used: 0.104 (sec). Leaf size: 32
ode:=diff(y(x),x) = x/y(x)+y(x)/x; 
ic:=y(-1) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\begin{align*} y &= \sqrt {2 \ln \left (x \right )-2 i \pi }\, x \\ y &= -\sqrt {2 \ln \left (x \right )-2 i \pi }\, x \\ \end{align*}
Mathematica. Time used: 0.184 (sec). Leaf size: 48
ode=D[y[x],x]==x/y[x]+y[x]/x; 
ic={y[-1]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\sqrt {2} x \sqrt {\log (x)-i \pi } \\ y(x)\to \sqrt {2} x \sqrt {\log (x)-i \pi } \\ \end{align*}
Sympy. Time used: 0.388 (sec). Leaf size: 36
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): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - x \sqrt {2 \log {\left (x \right )} - 2 i \pi }, \ y{\left (x \right )} = x \sqrt {2 \log {\left (x \right )} - 2 i \pi }\right ] \]