9.11.5 problem 5

Internal problem ID [3115]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 19, page 86
Problem number : 5
Date solved : Tuesday, September 30, 2025 at 06:27:11 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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