73.4.28 problem 5.4 (b)

Internal problem ID [15039]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 5. LINEAR FIRST ORDER EQUATIONS. Additional exercises. page 103
Problem number : 5.4 (b)
Date solved : Monday, March 31, 2025 at 01:13:46 PM
CAS classification : [_linear]

\begin{align*} x^{2} y^{\prime }+x y&=\sqrt {x}\, \sin \left (x \right ) \end{align*}

With initial conditions

\begin{align*} y \left (2\right )&=5 \end{align*}

Maple. Time used: 0.054 (sec). Leaf size: 42
ode:=x^2*diff(y(x),x)+x*y(x) = x^(1/2)*sin(x); 
ic:=y(2) = 5; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\sqrt {2}\, \sqrt {\pi }\, \operatorname {FresnelS}\left (\frac {\sqrt {2}\, \sqrt {x}}{\sqrt {\pi }}\right )+10-\sqrt {2}\, \sqrt {\pi }\, \operatorname {FresnelS}\left (\frac {2}{\sqrt {\pi }}\right )}{x} \]
Mathematica. Time used: 0.078 (sec). Leaf size: 185
ode=x^2*D[y[x],x]+x*y[x]==Sqrt[x]*Sin[x]; 
ic={y[2]==5}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {2 i \sqrt {\pi } x \text {erf}\left (\sqrt {i x}\right )-(1+i) \sqrt {2 \pi } \text {erf}(1+i) \sqrt {i x} \sqrt {x}-2 i \sqrt {\pi } x \text {erfi}\left (\sqrt {i x}\right )+(1+i) \sqrt {2 \pi } \text {erfi}(1+i) \sqrt {i x} \sqrt {x}-2 \sqrt {\pi } \sqrt {x^2}-2 i \sqrt {\pi } x+2 \sqrt {2 \pi } \sqrt {i x} \sqrt {x}+40 \sqrt {i x} \sqrt {x}}{4 \sqrt {i x} x^{3/2}} \]
Sympy. Time used: 1.955 (sec). Leaf size: 51
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-sqrt(x)*sin(x) + x**2*Derivative(y(x), x) + x*y(x),0) 
ics = {y(2): 5} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {\sqrt {2} \sqrt {\pi } S\left (\frac {\sqrt {2} \sqrt {x}}{\sqrt {\pi }}\right ) - \sqrt {2} \sqrt {\pi } S\left (\frac {2}{\sqrt {\pi }}\right ) + 10}{x} \]