29.10.25 problem 291

Internal problem ID [4891]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 10
Problem number : 291
Date solved : Sunday, March 30, 2025 at 04:09:15 AM
CAS classification : [_linear]

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

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