75.16.15 problem 488

Internal problem ID [16988]
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 : 488
Date solved : Tuesday, January 28, 2025 at 09:45:09 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.007 (sec). Leaf size: 42

dsolve(diff(y(x),x$2)+k^2*y(x)=k*sin(k*x+alpha),y(x), singsol=all)
 
\[ y = \frac {4 \sin \left (k x \right ) c_{2} k +4 \cos \left (k x \right ) c_{1} k -2 k x \cos \left (k x +\alpha \right )+\sin \left (k x +\alpha \right )}{4 k} \]

Solution by Mathematica

Time used: 0.136 (sec). Leaf size: 71

DSolve[D[y[x],{x,2}]+k^2*y[x]==k*Sin[k*x+\[Alpha]],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \cos (k x) \int _1^x-\sin (k K[1]) \sin (\alpha +k K[1])dK[1]+\sin (k x) \int _1^x\cos (k K[2]) \sin (\alpha +k K[2])dK[2]+c_1 \cos (k x)+c_2 \sin (k x) \]