30.5.4 problem 4

Internal problem ID [7503]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.6, Substitutions and Transformations. Exercises. page 76
Problem number : 4
Date solved : Tuesday, September 30, 2025 at 04:40:17 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

\begin{align*} \left (t +x+2\right ) x^{\prime }+3 t -x-6&=0 \end{align*}
Maple. Time used: 0.145 (sec). Leaf size: 47
ode:=(t+x(t)+2)*diff(x(t),t)+3*t-x(t)-6 = 0; 
dsolve(ode,x(t), singsol=all);
 
\[ x = -3-\tan \left (\operatorname {RootOf}\left (\sqrt {3}\, \ln \left (\left (t -1\right )^{2} \sec \left (\textit {\_Z} \right )^{2}\right )+\sqrt {3}\, \ln \left (3\right )+2 \sqrt {3}\, c_1 -2 \textit {\_Z} \right )\right ) \left (t -1\right ) \sqrt {3} \]
Mathematica. Time used: 0.059 (sec). Leaf size: 72
ode=(t+x[t]+2)*D[x[t],t]+(3*t-x[t]-6)==0; 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\frac {\arctan \left (\frac {-x(t)+3 t-6}{\sqrt {3} (x(t)+t+2)}\right )}{\sqrt {3}}+\log (2)=\frac {1}{2} \log \left (\frac {3 t^2+x(t)^2+6 x(t)-6 t+12}{(t-1)^2}\right )+\log (t-1)+c_1,x(t)\right ] \]
Sympy. Time used: 2.814 (sec). Leaf size: 48
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(3*t + (t + x(t) + 2)*Derivative(x(t), t) - x(t) - 6,0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ \log {\left (t - 1 \right )} = C_{1} - \log {\left (\sqrt {3 + \frac {\left (x{\left (t \right )} + 3\right )^{2}}{\left (t - 1\right )^{2}}} \right )} - \frac {\sqrt {3} \operatorname {atan}{\left (\frac {\sqrt {3} \left (x{\left (t \right )} + 3\right )}{3 \left (t - 1\right )} \right )}}{3} \]