23.3.68 problem 70

Internal problem ID [5782]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 70
Date solved : Tuesday, September 30, 2025 at 02:03:00 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y+2 y^{\prime }+y^{\prime \prime }&=\cos \left (x \right ) {\mathrm e}^{-x} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 18
ode:=y(x)+2*diff(y(x),x)+diff(diff(y(x),x),x) = cos(x)/exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-x} \left (c_2 +c_1 x -\cos \left (x \right )\right ) \]
Mathematica. Time used: 0.031 (sec). Leaf size: 22
ode=y[x] + 2*D[y[x],x] + D[y[x],{x,2}] == Cos[x]/E^x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-x} (-\cos (x)+c_2 x+c_1) \end{align*}
Sympy. Time used: 0.162 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - exp(-x)*cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + C_{2} x - \cos {\left (x \right )}\right ) e^{- x} \]