73.4.25 problem 5.3 (e)

Internal problem ID [15036]
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.3 (e)
Date solved : Monday, March 31, 2025 at 01:13:37 PM
CAS classification : [_linear]

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

With initial conditions

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

Maple. Time used: 0.020 (sec). Leaf size: 10
ode:=x*diff(y(x),x) = y(x)+x^2*cos(x); 
ic:=y(1/2*Pi) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \left (\sin \left (x \right )-1\right ) x \]
Mathematica. Time used: 0.034 (sec). Leaf size: 21
ode=x*D[y[x],x]==y[x]+x^2*Cos[x]; 
ic={y[Pi/2]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x \int _{\frac {\pi }{2}}^x\cos (K[1])dK[1] \]
Sympy. Time used: 0.327 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*cos(x) + x*Derivative(y(x), x) - y(x),0) 
ics = {y(pi/2): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (\sin {\left (x \right )} - 1\right ) \]