12.1.7 problem 3(b)

Internal problem ID [1525]
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 : 3(b)
Date solved : Saturday, March 29, 2025 at 10:57:39 PM
CAS classification : [_quadrature]

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

Maple. Time used: 0.001 (sec). Leaf size: 14
ode:=diff(y(x),x) = -x*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\sin \left (x \right )+x \cos \left (x \right )+c_1 \]
Mathematica. Time used: 0.005 (sec). Leaf size: 16
ode=D[y[x],x] == -x*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\sin (x)+x \cos (x)+c_1 \]
Sympy. Time used: 0.114 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*sin(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} + x \cos {\left (x \right )} - \sin {\left (x \right )} \]