7.7.34 problem 34

Internal problem ID [212]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Review problems at page 98
Problem number : 34
Date solved : Saturday, March 29, 2025 at 04:47:36 PM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.017 (sec). Leaf size: 51
ode:=diff(y(x),x) = (x+3*y(x))/(y(x)-3*x); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \frac {3 c_1 x -\sqrt {10 x^{2} c_1^{2}+1}}{c_1} \\ y &= \frac {3 c_1 x +\sqrt {10 x^{2} c_1^{2}+1}}{c_1} \\ \end{align*}
Mathematica. Time used: 0.438 (sec). Leaf size: 94
ode=D[y[x],x] ==  (x+3*y[x])/(y[x]-3*x); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to 3 x-\sqrt {10 x^2+e^{2 c_1}} \\ y(x)\to 3 x+\sqrt {10 x^2+e^{2 c_1}} \\ y(x)\to 3 x-\sqrt {10} \sqrt {x^2} \\ y(x)\to \sqrt {10} \sqrt {x^2}+3 x \\ \end{align*}
Sympy. Time used: 1.338 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x + 3*y(x))/(-3*x + y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = 3 x - \sqrt {C_{1} + 10 x^{2}}, \ y{\left (x \right )} = 3 x + \sqrt {C_{1} + 10 x^{2}}\right ] \]