35.6.14 problem 14

Internal problem ID [6164]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 6. SECOND-ORDER LINEAR EQUATIONSWITH CONSTANT COEFFICIENTS AND RIGHT-HAND SIDE NOT ZERO. page 422
Problem number : 14
Date solved : Sunday, March 30, 2025 at 10:41:42 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+8 y^{\prime }+25 y&=120 \sin \left (5 x \right ) \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 31
ode:=diff(diff(y(x),x),x)+8*diff(y(x),x)+25*y(x) = 120*sin(5*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-4 x} \sin \left (3 x \right ) c_2 +{\mathrm e}^{-4 x} \cos \left (3 x \right ) c_1 -3 \cos \left (5 x \right ) \]
Mathematica. Time used: 0.022 (sec). Leaf size: 36
ode=D[y[x],{x,2}]+8*D[y[x],x]+25*y[x]==120*Sin[5*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -3 \cos (5 x)+c_2 e^{-4 x} \cos (3 x)+c_1 e^{-4 x} \sin (3 x) \]
Sympy. Time used: 0.213 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(25*y(x) - 120*sin(5*x) + 8*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} \sin {\left (3 x \right )} + C_{2} \cos {\left (3 x \right )}\right ) e^{- 4 x} - 3 \cos {\left (5 x \right )} \]