38.2.16 problem 16

Internal problem ID [6445]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Further problems 24. page 1068
Problem number : 16
Date solved : Sunday, March 30, 2025 at 11:01:19 AM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

\begin{align*} \left (3 x +3 y-4\right ) y^{\prime }&=-x -y \end{align*}

Maple. Time used: 0.024 (sec). Leaf size: 21
ode:=(3*x+3*y(x)-4)*diff(y(x),x) = -x-y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {2 \operatorname {LambertW}\left (\frac {3 \,{\mathrm e}^{x -3-c_1}}{2}\right )}{3}-x +2 \]
Mathematica. Time used: 3.184 (sec). Leaf size: 33
ode=(3*x+3*y[x]-4)*D[y[x],x]==-(x+y[x]); 
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.869 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x + (3*x + 3*y(x) - 4)*Derivative(y(x), x) + y(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 \]