32.5.15 problem Exercise 11.16, page 97

Internal problem ID [5853]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 2. Special types of differential equations of the first kind. Lesson 11, Bernoulli Equations
Problem number : Exercise 11.16, page 97
Date solved : Tuesday, March 04, 2025 at 11:48:28 PM
CAS classification : [_linear]

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

Maple. Time used: 0.003 (sec). Leaf size: 17
ode:=x*diff(y(x),x)+y(x) = x*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {\sin \left (x \right )-\cos \left (x \right ) x +c_{1}}{x} \]
Mathematica. Time used: 0.035 (sec). Leaf size: 19
ode=x*D[y[x],x]+y[x]==x*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\sin (x)-x \cos (x)+c_1}{x} \]
Sympy. Time used: 0.295 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*sin(x) + x*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}}{x} - \cos {\left (x \right )} + \frac {\sin {\left (x \right )}}{x} \]