12.1.10 problem 4(b)

Internal problem ID [1528]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 1, Introduction. Section 1.2 Page 14
Problem number : 4(b)
Date solved : Saturday, March 29, 2025 at 10:57:42 PM
CAS classification : [_quadrature]

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

With initial conditions

\begin{align*} y \left (\frac {\sqrt {2}\, \sqrt {\pi }}{2}\right )&=1 \end{align*}

Maple. Time used: 0.022 (sec). Leaf size: 12
ode:=diff(y(x),x) = x*sin(x^2); 
ic:=y(1/2*2^(1/2)*Pi^(1/2)) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\frac {\cos \left (x^{2}\right )}{2}+1 \]
Mathematica. Time used: 0.011 (sec). Leaf size: 15
ode=D[y[x],x] == x*Sin[x^2]; 
ic=y[Sqrt[Pi/2]]==1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to 1-\frac {\cos \left (x^2\right )}{2} \]
Sympy. Time used: 0.181 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*sin(x**2) + Derivative(y(x), x),0) 
ics = {y(sqrt(2)*sqrt(pi)/2): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 1 - \frac {\cos {\left (x^{2} \right )}}{2} \]