23.1.2 problem 2

Internal problem ID [4609]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 2
Date solved : Tuesday, September 30, 2025 at 07:36:52 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }&=x +\sin \left (x \right )+y \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 21
ode:=diff(y(x),x) = x+sin(x)+y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -x -1-\frac {\cos \left (x \right )}{2}-\frac {\sin \left (x \right )}{2}+{\mathrm e}^{x} c_1 \]
Mathematica. Time used: 0.044 (sec). Leaf size: 28
ode=D[y[x],x]==x+Sin[x]+y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -x-\frac {\sin (x)}{2}-\frac {\cos (x)}{2}+c_1 e^x-1 \end{align*}
Sympy. Time used: 0.077 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x - y(x) - sin(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{x} - x - \frac {\sin {\left (x \right )}}{2} - \frac {\cos {\left (x \right )}}{2} - 1 \]