34.13.11 problem 32

Internal problem ID [8052]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 18. Linear equations with variable coefficients (Equations of second order). Supplemetary problems. Page 120
Problem number : 32
Date solved : Tuesday, September 30, 2025 at 05:14:47 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} \left (x \sin \left (x \right )+\cos \left (x \right )\right ) y^{\prime \prime }-x \cos \left (x \right ) y^{\prime }+y \cos \left (x \right )&=x \end{align*}
Maple. Time used: 0.036 (sec). Leaf size: 17
ode:=(x*sin(x)+cos(x))*diff(diff(y(x),x),x)-x*cos(x)*diff(y(x),x)+y(x)*cos(x) = x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -c_1 \cos \left (x \right )+c_2 x -\sin \left (x \right ) \]
Mathematica. Time used: 0.725 (sec). Leaf size: 108
ode=(x*Sin[x]+Cos[x])*D[y[x],{x,2}]-x*Cos[x]*D[y[x],x]+y[x]*Cos[x]==x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x \left (\int _1^x-\frac {K[2]^2 \int _1^{K[2]}\frac {\cos (K[1])+K[1] \sin (K[1])}{K[1]^2}dK[1]}{(\cos (K[2])+K[2] \sin (K[2]))^2}dK[2]+\int _1^x\frac {\cos (K[1])+K[1] \sin (K[1])}{K[1]^2}dK[1] \left (\int _1^x\frac {K[3]^2}{(\cos (K[3])+K[3] \sin (K[3]))^2}dK[3]+c_2\right )+c_1\right ) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*cos(x)*Derivative(y(x), x) - x + (x*sin(x) + cos(x))*Derivative(y(x), (x, 2)) + y(x)*cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (x*tan(x)*Derivative(y(x), (x, 2)) - x/cos(x) + y(x) + Derivative(y(x), (x, 2)))/x cannot be solved by the factorable group method