19.2.4 problem 4

Internal problem ID [3533]
Book : Differential equations and linear algebra, Stephen W. Goode, second edition, 2000
Section : 1.6, page 50
Problem number : 4
Date solved : Sunday, March 30, 2025 at 01:46:22 AM
CAS classification : [_linear]

\begin{align*} y^{\prime }+\frac {2 x y}{x^{2}+1}&=4 x \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 18
ode:=diff(y(x),x)+2*x/(x^2+1)*y(x) = 4*x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x^{2}+1+\frac {c_1}{x^{2}+1} \]
Mathematica. Time used: 0.033 (sec). Leaf size: 24
ode=D[y[x],x]+2*x/(1+x^2)*y[x]==4*x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {x^4+2 x^2+c_1}{x^2+1} \]
Sympy. Time used: 0.246 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*x + 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} + 2 x^{2}}{x^{2} + 1} \]