10.6.29 problem 29

Internal problem ID [1246]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Miscellaneous problems, end of chapter 2. Page 133
Problem number : 29
Date solved : Saturday, March 29, 2025 at 10:49:58 PM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.009 (sec). Leaf size: 24
ode:=diff(y(x),x) = (x+y(x))/(x-y(x)); 
dsolve(ode,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 )+2 c_1 \right )\right ) x \]
Mathematica. Time used: 0.033 (sec). Leaf size: 36
ode=D[y[x],x] == (x+y[x])/(x-y[x]); 
ic={}; 
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)+c_1,y(x)\right ] \]
Sympy. Time used: 1.004 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x + y(x))/(x - y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \log {\left (x \right )} = C_{1} - \log {\left (\sqrt {1 + \frac {y^{2}{\left (x \right )}}{x^{2}}} \right )} + \operatorname {atan}{\left (\frac {y{\left (x \right )}}{x} \right )} \]