81.3.4 problem 4

Internal problem ID [18543]
Book : A short course on differential equations. By Donald Francis Campbell. Maxmillan company. London. 1907
Section : Chapter III. Ordinary differential equations of the first order and first degree. Exercises at page 33
Problem number : 4
Date solved : Friday, March 14, 2025 at 04:54:17 AM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 55
ode:=(x^2+1)*diff(y(x),x)+x^2*y(x) = x^3-x^2*arctan(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = -\frac {{\mathrm e}^{\arctan \left (x \right )-x} \left (\left (i \ln \left (-i x +1\right )-i \ln \left (i x +1\right )-2 x +2\right ) {\mathrm e}^{x} \left (i x +1\right )^{\frac {i}{2}} \left (-i x +1\right )^{-\frac {i}{2}}-2 c_{1} \right )}{2} \]
Mathematica. Time used: 0.129 (sec). Leaf size: 23
ode=(1+x^2)*D[y[x],x]+x^2*y[x]==x^3-x^2*ArcTan[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\arctan (x)+c_1 e^{\arctan (x)-x}+x-1 \]
Sympy. Time used: 24.601 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**3 + x**2*y(x) + x**2*atan(x) + (x**2 + 1)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- x + \operatorname {atan}{\left (x \right )}} + x - \operatorname {atan}{\left (x \right )} - 1 \]