20.4.18 problem Problem 27

Internal problem ID [3653]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.8, Change of Variables. page 79
Problem number : Problem 27
Date solved : Sunday, March 30, 2025 at 01:59:07 AM
CAS classification : [[_homogeneous, `class A`], _dAlembert]

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

With initial conditions

\begin{align*} y \left (3\right )&=4 \end{align*}

Maple. Time used: 0.287 (sec). Leaf size: 21
ode:=diff(y(x),x) = (y(x)-(x^2+y(x)^2)^(1/2))/x; 
ic:=y(3) = 4; 
dsolve([ode,ic],y(x), singsol=all);
 
\begin{align*} y &= \frac {x^{2}}{2}-\frac {1}{2} \\ y &= -\frac {x^{2}}{18}+\frac {9}{2} \\ \end{align*}
Mathematica. Time used: 0.213 (sec). Leaf size: 16
ode=D[y[x],x]==(y[x]-Sqrt[x^2+y[x]^2])/x; 
ic={y[3]==4}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {9}{2}-\frac {x^2}{18} \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (-sqrt(x**2 + y(x)**2) + y(x))/x,0) 
ics = {y(3): 4} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : Initial conditions produced too many solutions for constants