87.4.22 problem 33

Internal problem ID [23288]
Book : Ordinary differential equations with modern applications. Ladas, G. E. and Finizio, N. Wadsworth Publishing. California. 1978. ISBN 0-534-00552-7. QA372.F56
Section : Chapter 1. Elementary methods. First order differential equations. Exercise at page 37
Problem number : 33
Date solved : Thursday, October 02, 2025 at 09:28:43 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (0\right )&=1 \\ \end{align*}
Maple. Time used: 0.009 (sec). Leaf size: 19
ode:=2*x*y(x)+(x^2+1)*diff(y(x),x) = -2*x; 
ic:=[y(0) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {-x^{2}+1}{x^{2}+1} \]
Mathematica. Time used: 0.021 (sec). Leaf size: 20
ode=(1+x^2)*D[y[x],x]+2*x*y[x]==-2*x; 
ic={y[0]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1-x^2}{x^2+1} \end{align*}
Sympy. Time used: 0.173 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*y(x) + 2*x + (x**2 + 1)*Derivative(y(x), x),0) 
ics = {y(0): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {1 - x^{2}}{x^{2} + 1} \]