18.1.16 problem Problem 14.23 (a)

Internal problem ID [3472]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 14, First order ordinary differential equations. 14.4 Exercises, page 490
Problem number : Problem 14.23 (a)
Date solved : Tuesday, March 04, 2025 at 04:41:25 PM
CAS classification : [_linear]

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

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