18.1.13 problem Problem 14.15

Internal problem ID [3469]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 14, First order ordinary differential equations. 14.4 Exercises, page 490
Problem number : Problem 14.15
Date solved : Tuesday, March 04, 2025 at 04:41:14 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.025 (sec). Leaf size: 21
ode:=diff(y(x),x) = -(x+y(x))/(3*x+3*y(x)-4); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {2 \operatorname {LambertW}\left (\frac {3 \,{\mathrm e}^{x -3-c_{1}}}{2}\right )}{3}-x +2 \]
Mathematica. Time used: 3.144 (sec). Leaf size: 33
ode=D[y[x],x] == - (x+y[x])/(3*x+3*y[x]-4); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {2}{3} W\left (-e^{x-1+c_1}\right )-x+2 \\ y(x)\to 2-x \\ \end{align*}
Sympy. Time used: 0.813 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x + y(x))/(3*x + 3*y(x) - 4) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - x + \frac {2 W\left (C_{1} e^{x - 3}\right )}{3} + 2 \]