89.16.1 problem 1

Internal problem ID [24651]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 9. Nonhomogeneous Equations: Undetermined coefficients. Exercises at page 140
Problem number : 1
Date solved : Thursday, October 02, 2025 at 10:46:43 PM
CAS classification : [[_2nd_order, _missing_y]]

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