58.1.37 problem 37

Internal problem ID [9108]
Book : Second order enumerated odes
Section : section 1
Problem number : 37
Date solved : Wednesday, March 05, 2025 at 07:23:58 AM
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 = -c_{1} {\mathrm e}^{-x}+\frac {\sin \left (x \right )}{2}-\frac {\cos \left (x \right )}{2}+c_{2} \]
Mathematica. Time used: 0.079 (sec). Leaf size: 28
ode=D[y[x],{x,2}]+D[y[x],x]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{2} \left (\sin (x)-\cos (x)-2 c_1 e^{-x}\right )+c_2 \]
Sympy. Time used: 0.146 (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} \]