71.8.3 problem 3 (a)

Internal problem ID [14366]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 2. The Initial Value Problem. Exercises 2.4.4, page 115
Problem number : 3 (a)
Date solved : Monday, March 31, 2025 at 12:19:35 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (-1\right )&=1 \end{align*}

Maple. Time used: 0.016 (sec). Leaf size: 7
ode:=diff(y(x),x) = y(x)/x; 
ic:=y(-1) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -x \]
Mathematica. Time used: 0.022 (sec). Leaf size: 8
ode=D[y[x],x]==y[x]/x; 
ic={y[-1]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -x \]
Sympy. Time used: 0.102 (sec). Leaf size: 5
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - y(x)/x,0) 
ics = {y(-1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - x \]