71.7.5 problem 5

Internal problem ID [14355]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 2. The Initial Value Problem. Exercises 2.3.3, page 71
Problem number : 5
Date solved : Monday, March 31, 2025 at 12:19:05 PM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (-1\right )&=-1 \end{align*}

Maple. Time used: 0.028 (sec). Leaf size: 17
ode:=diff(y(x),x) = y(x)/x+sin(x^2); 
ic:=y(-1) = -1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\frac {\left (-\operatorname {Si}\left (x^{2}\right )-2+\operatorname {Si}\left (1\right )\right ) x}{2} \]
Mathematica. Time used: 0.033 (sec). Leaf size: 20
ode=D[y[x],x]==y[x]/x+Sin[x^2]; 
ic={y[-1]==-1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} x \left (\text {Si}\left (x^2\right )-\text {Si}(1)+2\right ) \]
Sympy. Time used: 0.934 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-sin(x**2) + Derivative(y(x), x) - y(x)/x,0) 
ics = {y(-1): -1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (\frac {\operatorname {Si}{\left (x^{2} \right )}}{2} - \frac {\operatorname {Si}{\left (1 \right )}}{2} + 1\right ) \]