29.11.14 problem 305

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

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

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