75.16.11 problem 484

Internal problem ID [16913]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 2 (Higher order ODEs). Section 15.3 Nonhomogeneous linear equations with constant coefficients. Trial and error method. Exercises page 132
Problem number : 484
Date solved : Monday, March 31, 2025 at 03:35:22 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+16 y&=\sin \left (4 x +\alpha \right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 34
ode:=diff(diff(y(x),x),x)+16*y(x) = sin(4*x+alpha); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (4 x \right ) c_2 +\cos \left (4 x \right ) c_1 -\frac {x \cos \left (4 x +\alpha \right )}{8}+\frac {\sin \left (4 x +\alpha \right )}{64} \]
Mathematica. Time used: 0.161 (sec). Leaf size: 76
ode=D[y[x],{x,2}]+16*y[x]==Sin[4*x+\[Alpha]]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \cos (4 x) \int _1^x-\frac {1}{4} \sin (4 K[1]) \sin (\alpha +4 K[1])dK[1]+\sin (4 x) \int _1^x\frac {1}{4} \cos (4 K[2]) \sin (\alpha +4 K[2])dK[2]+c_1 \cos (4 x)+c_2 \sin (4 x) \]
Sympy. Time used: 0.094 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
Alpha = symbols("Alpha") 
y = Function("y") 
ode = Eq(16*y(x) - sin(Alpha + 4*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (4 x \right )} + C_{2} \cos {\left (4 x \right )} - \frac {x \cos {\left (\mathrm {A} + 4 x \right )}}{8} \]