10.2.34 problem 35

Internal problem ID [1162]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Section 2.2. Page 48
Problem number : 35
Date solved : Thursday, March 13, 2025 at 03:54:01 PM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.013 (sec). Leaf size: 21
ode:=diff(y(x),x) = (x+3*y(x))/(x-y(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {x \left (\operatorname {LambertW}\left (-2 c_1 x \right )+2\right )}{\operatorname {LambertW}\left (-2 c_1 x \right )} \]
Mathematica. Time used: 0.109 (sec). Leaf size: 33
ode=D[y[x],x] == (x+3*y[x])/(x-y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {2}{\frac {y(x)}{x}+1}+\log \left (\frac {y(x)}{x}+1\right )=-\log (x)+c_1,y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x + 3*y(x))/(x - y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
RecursionError : maximum recursion depth exceeded