73.7.42 problem 42

Internal problem ID [15129]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 8. Review exercises for part of part II. page 143
Problem number : 42
Date solved : Monday, March 31, 2025 at 01:26:31 PM
CAS classification : [_quadrature]

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

Maple. Time used: 0.001 (sec). Leaf size: 15
ode:=diff(y(x),x)+2*x = sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -x^{2}-\cos \left (x \right )+c_1 \]
Mathematica. Time used: 0.005 (sec). Leaf size: 23
ode=D[y[x],x]+2*x==Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \int _1^x(\sin (K[1])-2 K[1])dK[1]+c_1 \]
Sympy. Time used: 0.136 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x - sin(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} - x^{2} - \cos {\left (x \right )} \]