72.9.9 problem 5 (c)

Internal problem ID [19543]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 14. Introduction. Problems at page 112
Problem number : 5 (c)
Date solved : Thursday, October 02, 2025 at 04:39:57 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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