69.17.32 problem 582

Internal problem ID [18368]
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 : 582
Date solved : Thursday, October 02, 2025 at 03:11:01 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+6 y^{\prime }+9 y&=18 \,{\mathrm e}^{-3 x}+8 \sin \left (x \right )+6 \cos \left (x \right ) \end{align*}
Maple. Time used: 0.007 (sec). Leaf size: 22
ode:=diff(diff(y(x),x),x)+6*diff(y(x),x)+9*y(x) = 18*exp(-3*x)+8*sin(x)+6*cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 x +9 x^{2}+c_2 \right ) {\mathrm e}^{-3 x}+\sin \left (x \right ) \]
Mathematica. Time used: 0.126 (sec). Leaf size: 86
ode=D[y[x],{x,2}]+6*D[y[x],x]+9*y[x]==18*Exp[-3*x]+8*Sin[x]+6*Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-3 x} \left (\int _1^x-2 K[1] \left (3 e^{3 K[1]} \cos (K[1])+4 e^{3 K[1]} \sin (K[1])+9\right )dK[1]+x \int _1^x\left (6 e^{3 K[2]} \cos (K[2])+8 e^{3 K[2]} \sin (K[2])+18\right )dK[2]+c_2 x+c_1\right ) \end{align*}
Sympy. Time used: 0.248 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(9*y(x) - 8*sin(x) - 6*cos(x) + 6*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 18*exp(-3*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + x \left (C_{2} + 9 x\right )\right ) e^{- 3 x} + \sin {\left (x \right )} \]