20.5.5 problem Problem 5

Internal problem ID [3688]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.9, Exact Differential Equations. page 91
Problem number : Problem 5
Date solved : Sunday, March 30, 2025 at 02:05:47 AM
CAS classification : [_separable]

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

Maple. Time used: 0.001 (sec). Leaf size: 13
ode:=2*x*y(x)+(x^2+1)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_1}{x^{2}+1} \]
Mathematica. Time used: 0.03 (sec). Leaf size: 20
ode=2*x*y[x]+(x^2+1)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {c_1}{x^2+1} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.203 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(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^{2} + 1} \]