29.6.17 problem 17

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

\begin{align*} y^{\prime \prime }+16 y&=16 \cos \left (4 x \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 29
ode:=diff(diff(y(x),x),x)+16*y(x) = 16*cos(4*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (2 c_2 +4 x \right ) \sin \left (4 x \right )}{2}+\frac {\left (2 c_1 +1\right ) \cos \left (4 x \right )}{2} \]
Mathematica. Time used: 0.049 (sec). Leaf size: 60
ode=D[y[x],{x,2}]+16*y[x]==16*Cos[4*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sin (4 x) \int _1^x4 \cos ^2(4 K[2])dK[2]+\cos (4 x) \int _1^x-2 \sin (8 K[1])dK[1]+c_1 \cos (4 x)+c_2 \sin (4 x) \end{align*}
Sympy. Time used: 0.045 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(16*y(x) - 16*cos(4*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{2} \cos {\left (4 x \right )} + \left (C_{1} + 2 x\right ) \sin {\left (4 x \right )} \]