1.11.10 problem 10

Internal problem ID [331]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 2. Linear Equations of Higher Order. Section 2.5 (Nonhomogeneous equations and undetermined coefficients). Problems at page 161
Problem number : 10
Date solved : Tuesday, September 30, 2025 at 03:57:27 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} 2 y^{\prime \prime }+9 y&=2 \cos \left (3 x \right )+3 \sin \left (3 x \right ) \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 35
ode:=2*diff(diff(y(x),x),x)+9*y(x) = 2*cos(3*x)+3*sin(3*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (\frac {3 \sqrt {2}\, x}{2}\right ) c_2 +\cos \left (\frac {3 \sqrt {2}\, x}{2}\right ) c_1 -\frac {2 \cos \left (3 x \right )}{9}-\frac {\sin \left (3 x \right )}{3} \]
Mathematica. Time used: 0.014 (sec). Leaf size: 46
ode=2*D[y[x],{x,2}]+9*y[x]==3*Cos[3*x]+3*Sin[3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {1}{3} \sin (3 x)-\frac {1}{3} \cos (3 x)+c_1 \cos \left (\frac {3 x}{\sqrt {2}}\right )+c_2 \sin \left (\frac {3 x}{\sqrt {2}}\right ) \end{align*}
Sympy. Time used: 0.054 (sec). Leaf size: 44
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(9*y(x) - 3*sin(3*x) - 2*cos(3*x) + 2*Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (\frac {3 \sqrt {2} x}{2} \right )} + C_{2} \cos {\left (\frac {3 \sqrt {2} x}{2} \right )} - \frac {\sin {\left (3 x \right )}}{3} - \frac {2 \cos {\left (3 x \right )}}{9} \]