8.6.21 problem 21

Internal problem ID [791]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Chapter 1 review problems. Page 78
Problem number : 21
Date solved : Tuesday, March 04, 2025 at 11:48:46 AM
CAS classification : [_linear]

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

Maple. Time used: 0.000 (sec). Leaf size: 16
ode:=(x-1)*y(x)+(x^2-1)*diff(y(x),x) = 1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\ln \left (x -1\right )+c_1}{x +1} \]
Mathematica. Time used: 0.03 (sec). Leaf size: 18
ode=(-1+x)*y[x]+(x^2-1)*D[y[x],x] == 1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\log (x-1)+c_1}{x+1} \]
Sympy. Time used: 0.219 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x - 1)*y(x) + (x**2 - 1)*Derivative(y(x), x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + \log {\left (x - 1 \right )}}{x + 1} \]