9.2.18 problem 18

Internal problem ID [2888]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 6, page 25
Problem number : 18
Date solved : Tuesday, September 30, 2025 at 05:58:25 AM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class A`]]

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

With initial conditions

\begin{align*} y \left (1\right )&=0 \\ \end{align*}
Maple. Time used: 0.074 (sec). Leaf size: 23
ode:=diff(y(x),x) = (x+y(x))/(x-y(x)); 
ic:=[y(1) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \tan \left (\operatorname {RootOf}\left (2 \textit {\_Z} -\ln \left (\sec \left (\textit {\_Z} \right )^{2}\right )-2 \ln \left (x \right )\right )\right ) x \]
Mathematica. Time used: 0.026 (sec). Leaf size: 33
ode=D[y[x],x]==(x+y[x])/(x-y[x]); 
ic=y[1]==0; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {1}{2} \log \left (\frac {y(x)^2}{x^2}+1\right )-\arctan \left (\frac {y(x)}{x}\right )=-\log (x),y(x)\right ] \]
Sympy. Time used: 0.634 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x + y(x))/(x - y(x)),0) 
ics = {y(1): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \log {\left (x \right )} = - \log {\left (\sqrt {1 + \frac {y^{2}{\left (x \right )}}{x^{2}}} \right )} + \operatorname {atan}{\left (\frac {y{\left (x \right )}}{x} \right )} \]