82.12.14 problem Ex. 14

Internal problem ID [18708]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter II. Equations of the first order and of the first degree. Examples on chapter II at page 29
Problem number : Ex. 14
Date solved : Monday, March 31, 2025 at 06:02:03 PM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 20
ode:=x*(-x^2+1)*diff(y(x),x)+(2*x^2-1)*y(x) = a*x^3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x \left (c_1 \sqrt {x +1}\, \sqrt {x -1}+a \right ) \]
Mathematica. Time used: 0.054 (sec). Leaf size: 23
ode=x*(1-x^2)*D[y[x],x]+(2*x^2-1)*y[x]==a*x^3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \left (a+c_1 \sqrt {1-x^2}\right ) \]
Sympy. Time used: 38.191 (sec). Leaf size: 338
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(-a*x**3 + x*(1 - x**2)*Derivative(y(x), x) + (2*x**2 - 1)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \begin {cases} \frac {C_{1} \sqrt {1 - x^{2}} \sqrt {x^{2} - 1}}{2 x \sqrt {1 - x^{2}} + 2 i x \sqrt {x^{2} - 1} - 2 \sqrt {1 - x^{2}} \sqrt {x^{2} - 1} \left (\begin {cases} - \frac {x}{\sqrt {x^{2} - 1}} & \text {for}\: \left |{x^{2}}\right | > 1 \\\frac {i x}{\sqrt {1 - x^{2}}} & \text {otherwise} \end {cases}\right ) + \sqrt {1 - x^{2}} \sqrt {x^{2} - 1} \left (\begin {cases} - \frac {2 x}{\sqrt {x^{2} - 1}} + \frac {1}{x \sqrt {x^{2} - 1}} & \text {for}\: \left |{x^{2}}\right | > 1 \\- \frac {2 i x^{2} \sqrt {1 - x^{2}}}{x^{3} - x} + \frac {i \sqrt {1 - x^{2}}}{x^{3} - x} & \text {otherwise} \end {cases}\right )} + \frac {a \sqrt {1 - x^{2}}}{2 x \sqrt {1 - x^{2}} + 2 i x \sqrt {x^{2} - 1} - 2 \sqrt {1 - x^{2}} \sqrt {x^{2} - 1} \left (\begin {cases} - \frac {x}{\sqrt {x^{2} - 1}} & \text {for}\: \left |{x^{2}}\right | > 1 \\\frac {i x}{\sqrt {1 - x^{2}}} & \text {otherwise} \end {cases}\right ) + \sqrt {1 - x^{2}} \sqrt {x^{2} - 1} \left (\begin {cases} - \frac {2 x}{\sqrt {x^{2} - 1}} + \frac {1}{x \sqrt {x^{2} - 1}} & \text {for}\: \left |{x^{2}}\right | > 1 \\- \frac {2 i x^{2} \sqrt {1 - x^{2}}}{x^{3} - x} + \frac {i \sqrt {1 - x^{2}}}{x^{3} - x} & \text {otherwise} \end {cases}\right )} & \text {for}\: x > -1 \wedge x < 1 \\\text {NaN} & \text {otherwise} \end {cases} \]