75.25.3 problem 759

Internal problem ID [17226]
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 18.3. Finding periodic solutions of linear differential equations. Exercises page 187
Problem number : 759
Date solved : Tuesday, January 28, 2025 at 09:58:04 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-4 y&=\cos \left (\pi x \right ) \end{align*}

Solution by Maple

Time used: 0.006 (sec). Leaf size: 41

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

Solution by Mathematica

Time used: 0.082 (sec). Leaf size: 72

DSolve[D[y[x],{x,2}]-4*y[x]==Cos[Pi*x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to e^{-2 x} \left (e^{4 x} \int _1^x\frac {1}{4} e^{-2 K[1]} \cos (\pi K[1])dK[1]+\int _1^x-\frac {1}{4} e^{2 K[2]} \cos (\pi K[2])dK[2]+c_1 e^{4 x}+c_2\right ) \]