76.5.12 problem 12

Internal problem ID [17361]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 2. First order differential equations. Section 2.7 (Substitution Methods). Problems at page 108
Problem number : 12
Date solved : Monday, March 31, 2025 at 03:59:46 PM
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 (5\right )&=8 \end{align*}

Maple
ode:=diff(y(x),x) = (x+y(x))/(x-y(x)); 
ic:=y(5) = 8; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ \text {No solution found} \]
Mathematica. Time used: 0.044 (sec). Leaf size: 58
ode=D[y[x],x]==(x+y[x])/(x-y[x]); 
ic={y[5]==8}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\int _5^{\frac {y(x)}{x}}\frac {K[1]-1}{K[1]^2+1}dK[1]=\int _5^{\frac {8}{5}}\frac {K[1]-1}{K[1]^2+1}dK[1]-\log (x)+\log (5),y(x)\right ] \]
Sympy. Time used: 0.965 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x + y(x))/(x - y(x)),0) 
ics = {y(5): 8} 
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 )} - \operatorname {atan}{\left (\frac {8}{5} \right )} + \frac {\log {\left (89 \right )}}{2} \]