40.4.14 problem 19 (p)

Internal problem ID [6654]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 6. Equations of first order and first degree (Linear equations). Supplemetary problems. Page 39
Problem number : 19 (p)
Date solved : Sunday, March 30, 2025 at 11:13:54 AM
CAS classification : [_linear]

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

Maple. Time used: 0.001 (sec). Leaf size: 11
ode:=x*diff(y(x),x) = y(x)*(1-x*tan(x))+x^2*cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (x +c_1 \right ) \cos \left (x \right ) x \]
Mathematica. Time used: 0.073 (sec). Leaf size: 13
ode=x*D[y[x],x]==y[x]*(1-x*Tan[x])+x^2*Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to x (x+c_1) \cos (x) \]
Sympy. Time used: 7.744 (sec). Leaf size: 54
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*cos(x) + x*Derivative(y(x), x) - (-x*tan(x) + 1)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \int \sqrt {\tan ^{2}{\left (x \right )} + 1} \cos {\left (x \right )}\, dx - \int \frac {\sqrt {\tan ^{2}{\left (x \right )} + 1} y{\left (x \right )}}{x^{2}}\, dx + \int \frac {\sqrt {\tan ^{2}{\left (x \right )} + 1} y{\left (x \right )} \tan {\left (x \right )}}{x}\, dx = C_{1} \]