43.6.2 problem 1(b)

Internal problem ID [8916]
Book : An introduction to Ordinary Differential Equations. Earl A. Coddington. Dover. NY 1961
Section : Chapter 2. Linear equations with constant coefficients. Page 69
Problem number : 1(b)
Date solved : Tuesday, September 30, 2025 at 06:00:07 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+9 y&=\sin \left (3 x \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 24
ode:=diff(diff(y(x),x),x)+9*y(x) = sin(3*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (6 c_1 -x \right ) \cos \left (3 x \right )}{6}+\sin \left (3 x \right ) c_2 \]
Mathematica. Time used: 0.022 (sec). Leaf size: 64
ode=D[y[x],{x,2}]+9*y[x]==Sin[3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sin (3 x) \int _1^x\frac {1}{6} \sin (6 K[2])dK[2]+\cos (3 x) \int _1^x-\frac {1}{3} \sin ^2(3 K[1])dK[1]+c_1 \cos (3 x)+c_2 \sin (3 x) \end{align*}
Sympy. Time used: 0.056 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(9*y(x) - 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} - \frac {x}{6}\right ) \cos {\left (3 x \right )} \]