78.8.21 problem 21

Internal problem ID [18148]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 2. First order equations. Miscellaneous Problems for Chapter 2. Problems at page 99
Problem number : 21
Date solved : Monday, March 31, 2025 at 05:14:24 PM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 17
ode:=(x^2+1)*diff(y(x),x)+2*x*y(x) = 4*x^3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x^{4}+c_1}{x^{2}+1} \]
Mathematica. Time used: 0.032 (sec). Leaf size: 19
ode=(1+x^2)*D[y[x],x]+2*x*y[x]==4*x^3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {x^4+c_1}{x^2+1} \]
Sympy. Time used: 0.230 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*x**3 + 2*x*y(x) + (x**2 + 1)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + x^{4}}{x^{2} + 1} \]