69.1.12 problem 14

Internal problem ID [17962]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 1. Basic concepts and definitions. Exercises page 18
Problem number : 14
Date solved : Thursday, October 02, 2025 at 02:31:32 PM
CAS classification : [_linear]

\begin{align*} x y^{\prime }+y&=\cos \left (x \right ) \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 12
ode:=x*diff(y(x),x)+y(x) = cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\sin \left (x \right )+c_1}{x} \]
Mathematica. Time used: 0.019 (sec). Leaf size: 22
ode=x*D[y[x],x]+y[x]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\int _1^x\cos (K[1])dK[1]+c_1}{x} \end{align*}
Sympy. Time used: 0.148 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) + y(x) - cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + \sin {\left (x \right )}}{x} \]