38.1.8 problem 8

Internal problem ID [6425]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Test excercise 24. page 1067
Problem number : 8
Date solved : Wednesday, March 05, 2025 at 12:41:18 AM
CAS classification : [_separable]

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

Maple. Time used: 0.002 (sec). Leaf size: 21
ode:=(x^2-1)*diff(y(x),x)+2*x*y(x) = x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {x^{2}+2 c_1}{2 x^{2}-2} \]
Mathematica. Time used: 0.032 (sec). Leaf size: 31
ode=(x^2-1)*D[y[x],x]+2*x*y[x]==x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {x^2+2 c_1}{2 \left (x^2-1\right )} \\ y(x)\to \frac {1}{2} \\ \end{align*}
Sympy. Time used: 0.301 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*y(x) - 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}}{2 \left (x^{2} - 1\right )} \]