86.10.6 problem 6

Internal problem ID [23186]
Book : An introduction to Differential Equations. By Howard Frederick Cleaves. 1969. Oliver and Boyd publisher. ISBN 0050015044
Section : Chapter 9. The operational method. Exercise 9b at page 134
Problem number : 6
Date solved : Thursday, October 02, 2025 at 09:24:09 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y+2 y^{\prime }+y^{\prime \prime }&=\cos \left (x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 19
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+y(x) = cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 x +c_2 \right ) {\mathrm e}^{-x}+\frac {\sin \left (x \right )}{2} \]
Mathematica. Time used: 0.049 (sec). Leaf size: 25
ode=D[y[x],{x,2}]+2*D[y[x],x]+y[x]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {\sin (x)}{2}+e^{-x} (c_2 x+c_1) \end{align*}
Sympy. Time used: 0.119 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - cos(x) + 2*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} + C_{2} x\right ) e^{- x} + \frac {\sin {\left (x \right )}}{2} \]