32.2.13 problem 13

Internal problem ID [7730]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Further problems 24. page 1068
Problem number : 13
Date solved : Tuesday, September 30, 2025 at 05:02:46 PM
CAS classification : [_linear]

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

With initial conditions

\begin{align*} y \left (\pi \right )&=0 \\ \end{align*}
Maple. Time used: 0.020 (sec). Leaf size: 14
ode:=-y(x)+x*diff(y(x),x) = x^3*cos(x); 
ic:=[y(Pi) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \left (\cos \left (x \right )+x \sin \left (x \right )+1\right ) x \]
Mathematica. Time used: 0.033 (sec). Leaf size: 20
ode=x*D[y[x],x]-y[x]==x^3*Cos[x]; 
ic={y[Pi]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x \int _{\pi }^x\cos (K[1]) K[1]dK[1] \end{align*}
Sympy. Time used: 0.230 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**3*cos(x) + x*Derivative(y(x), x) - y(x),0) 
ics = {y(pi): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (x \sin {\left (x \right )} + \cos {\left (x \right )} + 1\right ) \]