85.15.10 problem 1 (j)

Internal problem ID [22535]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter two. First order and simple higher order ordinary differential equations. A Exercises at page 47
Problem number : 1 (j)
Date solved : Thursday, October 02, 2025 at 08:48:33 PM
CAS classification : [_quadrature]

\begin{align*} \left (x^{2}+x \right ) y^{\prime }+2 x +1+2 \cos \left (x \right )&=0 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 36
ode:=(x^2+x)*diff(y(x),x)+2*x+1+2*cos(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\ln \left (x +1\right )-\ln \left (x \right )-2 \,\operatorname {Ci}\left (x \right )+2 \,\operatorname {Si}\left (x +1\right ) \sin \left (1\right )+2 \,\operatorname {Ci}\left (x +1\right ) \cos \left (1\right )+c_1 \]
Mathematica. Time used: 0.051 (sec). Leaf size: 38
ode=(x^2+x)*D[y[x],x]+(2*x+1+2*Cos[x])==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -2 \operatorname {CosIntegral}(x)+2 \cos (1) \operatorname {CosIntegral}(x+1)+2 \sin (1) \text {Si}(x+1)-\log (x)-\log (x+1)+c_1 \end{align*}
Sympy. Time used: 1.174 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x + (x**2 + x)*Derivative(y(x), x) + 2*cos(x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} - \log {\left (x \right )} - \log {\left (x + 1 \right )} - 2 \int \frac {\cos {\left (x \right )}}{x \left (x + 1\right )}\, dx \]