82.12.25 problem Ex. 27

Internal problem ID [18711]
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. 27
Date solved : Thursday, March 13, 2025 at 12:39:59 PM
CAS classification : [_linear]

\begin{align*} \sqrt {a^{2}+x^{2}}\, y^{\prime }+y&=\sqrt {a^{2}+x^{2}}-x \end{align*}

Maple. Time used: 0.000 (sec). Leaf size: 36
ode:=(a^2+x^2)^(1/2)*diff(y(x),x)+y(x) = (a^2+x^2)^(1/2)-x; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {a^{2} \ln \left (x +\sqrt {a^{2}+x^{2}}\right )+c_{1}}{x +\sqrt {a^{2}+x^{2}}} \]
Mathematica. Time used: 0.073 (sec). Leaf size: 42
ode=Sqrt[a^2+x^2]*D[y[x],x]+y[x]==Sqrt[a^2+x^2]-x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {a^2 \log \left (\sqrt {a^2+x^2}+x\right )+c_1}{\sqrt {a^2+x^2}+x} \]
Sympy. Time used: 5.537 (sec). Leaf size: 63
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(x + sqrt(a**2 + x**2)*Derivative(y(x), x) - sqrt(a**2 + x**2) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} - \int \frac {\left (x - \sqrt {a^{2} + x^{2}} + y{\left (x \right )}\right ) e^{\operatorname {asinh}{\left (\frac {x}{a} \right )}}}{\sqrt {a^{2} + x^{2}}}\, dx}{e^{\operatorname {asinh}{\left (\frac {x}{a} \right )}} - \int \frac {e^{\operatorname {asinh}{\left (\frac {x}{a} \right )}}}{\sqrt {a^{2} + x^{2}}}\, dx} \]