71.8.4 problem 3 (b)

Internal problem ID [14367]
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 (b)
Date solved : Monday, March 31, 2025 at 12:19:37 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.014 (sec). Leaf size: 5
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: 6
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.115 (sec). Leaf size: 3
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 \]