35.6.11 problem 11

Internal problem ID [6161]
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 : 11
Date solved : Sunday, March 30, 2025 at 10:41:37 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+2 y^{\prime }+10 y&=100 \cos \left (4 x \right ) \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 37
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+10*y(x) = 100*cos(4*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-x} \sin \left (3 x \right ) c_2 +{\mathrm e}^{-x} \cos \left (3 x \right ) c_1 +8 \sin \left (4 x \right )-6 \cos \left (4 x \right ) \]
Mathematica. Time used: 0.023 (sec). Leaf size: 42
ode=D[y[x],{x,2}]+2*D[y[x],x]+10*y[x]==100*Cos[4*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to 8 \sin (4 x)-6 \cos (4 x)+c_2 e^{-x} \cos (3 x)+c_1 e^{-x} \sin (3 x) \]
Sympy. Time used: 0.247 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(10*y(x) - 100*cos(4*x) + 2*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^{- x} + 8 \sin {\left (4 x \right )} - 6 \cos {\left (4 x \right )} \]