69.17.25 problem 575

Internal problem ID [18361]
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. Superposition principle. Exercises page 137
Problem number : 575
Date solved : Thursday, October 02, 2025 at 03:10:54 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-4 y^{\prime }+5 y&=1+8 \cos \left (x \right )+{\mathrm e}^{2 x} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 32
ode:=diff(diff(y(x),x),x)-4*diff(y(x),x)+5*y(x) = 1+8*cos(x)+exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{2 x} \sin \left (x \right ) c_2 +{\mathrm e}^{2 x} \cos \left (x \right ) c_1 +\cos \left (x \right )-\sin \left (x \right )+\frac {1}{5}+{\mathrm e}^{2 x} \]
Mathematica. Time used: 0.132 (sec). Leaf size: 89
ode=D[y[x],{x,2}]-4*D[y[x],x]+5*y[x]==1+8*Cos[x]+Exp[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{2 x} \left (\cos (x) \int _1^x-e^{-2 K[2]} \left (8 \cos (K[2])+e^{2 K[2]}+1\right ) \sin (K[2])dK[2]+\sin (x) \int _1^xe^{-2 K[1]} \cos (K[1]) \left (8 \cos (K[1])+e^{2 K[1]}+1\right )dK[1]+c_2 \cos (x)+c_1 \sin (x)\right ) \end{align*}
Sympy. Time used: 0.172 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(5*y(x) - exp(2*x) - 8*cos(x) - 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} \sin {\left (x \right )} + C_{2} \cos {\left (x \right )} + 1\right ) e^{2 x} - \sin {\left (x \right )} + \cos {\left (x \right )} + \frac {1}{5} \]