29.6.16 problem 16

Internal problem ID [7301]
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 : 16
Date solved : Tuesday, September 30, 2025 at 04:27:57 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+9 y&=30 \sin \left (3 x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 21
ode:=diff(diff(y(x),x),x)+9*y(x) = 30*sin(3*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 -5 x \right ) \cos \left (3 x \right )+\sin \left (3 x \right ) c_2 \]
Mathematica. Time used: 0.033 (sec). Leaf size: 60
ode=D[y[x],{x,2}]+9*y[x]==30*Sin[3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sin (3 x) \int _1^x5 \sin (6 K[2])dK[2]+\cos (3 x) \int _1^x-10 \sin ^2(3 K[1])dK[1]+c_1 \cos (3 x)+c_2 \sin (3 x) \end{align*}
Sympy. Time used: 0.053 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(9*y(x) - 30*sin(3*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{2} \sin {\left (3 x \right )} + \left (C_{1} - 5 x\right ) \cos {\left (3 x \right )} \]