75.16.62 problem 535

Internal problem ID [16956]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 2 (Higher order ODEs). Section 15.3 Nonhomogeneous linear equations with constant coefficients. Trial and error method. Exercises page 132
Problem number : 535
Date solved : Thursday, March 13, 2025 at 09:02:39 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+4 y^{\prime }+5 y&=10 \,{\mathrm e}^{-2 x} \cos \left (x \right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 22
ode:=diff(diff(y(x),x),x)+4*diff(y(x),x)+5*y(x) = 10*exp(-2*x)*cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\left (c_{2} +5 x \right ) \sin \left (x \right )+\cos \left (x \right ) c_{1} \right ) {\mathrm e}^{-2 x} \]
Mathematica. Time used: 0.051 (sec). Leaf size: 45
ode=D[y[x],{x,2}]+4*D[y[x],x]+5*y[x]==10*Exp[-2*x]*Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-2 x} \left (\sin (x) \int _1^x10 \cos ^2(K[1])dK[1]+5 \cos ^3(x)+c_2 \cos (x)+c_1 \sin (x)\right ) \]
Sympy. Time used: 0.314 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(5*y(x) + 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 10*exp(-2*x)*cos(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{2} \cos {\left (x \right )} + \left (C_{1} + 5 x\right ) \sin {\left (x \right )}\right ) e^{- 2 x} \]