37.2.7 problem 10.3.8

Internal problem ID [6404]
Book : Basic Training in Mathematics. By R. Shankar. Plenum Press. NY. 1995
Section : Chapter 10, Differential equations. Section 10.3, ODEs with variable Coefficients. First order. page 315
Problem number : 10.3.8
Date solved : Wednesday, March 05, 2025 at 12:39:13 AM
CAS classification : [_linear]

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

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