7.7.21 problem 21

Internal problem ID [199]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Review problems at page 98
Problem number : 21
Date solved : Tuesday, March 04, 2025 at 11:01:28 AM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 16
ode:=(x^2-1)*diff(y(x),x)+(x-1)*y(x) = 1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\ln \left (x -1\right )+c_1}{x +1} \]
Mathematica. Time used: 0.031 (sec). Leaf size: 18
ode=(x^2-1)*D[y[x],x]+(x-1)*y[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.251 (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} \]