34.11.7 problem 32

Internal problem ID [8028]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 16. Linear equations with constant coefficients (Short methods). Supplemetary problems. Page 107
Problem number : 32
Date solved : Tuesday, September 30, 2025 at 05:14:25 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+5 y&=\cos \left (\sqrt {5}\, x \right ) \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 35
ode:=diff(diff(y(x),x),x)+5*y(x) = cos(x*5^(1/2)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (10 c_1 +1\right ) \cos \left (\sqrt {5}\, x \right )}{10}+\frac {\sin \left (\sqrt {5}\, x \right ) \left (\sqrt {5}\, x +10 c_2 \right )}{10} \]
Mathematica. Time used: 0.09 (sec). Leaf size: 96
ode=D[y[x],{x,2}]+5*y[x]==Cos[Sqrt[5]*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sin \left (\sqrt {5} x\right ) \int _1^x\frac {\cos ^2\left (\sqrt {5} K[2]\right )}{\sqrt {5}}dK[2]+\cos \left (\sqrt {5} x\right ) \int _1^x-\frac {\sin \left (2 \sqrt {5} K[1]\right )}{2 \sqrt {5}}dK[1]+c_1 \cos \left (\sqrt {5} x\right )+c_2 \sin \left (\sqrt {5} x\right ) \end{align*}
Sympy. Time used: 0.060 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(5*y(x) - cos(sqrt(5)*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{2} \cos {\left (\sqrt {5} x \right )} + \left (C_{1} + \frac {\sqrt {5} x}{10}\right ) \sin {\left (\sqrt {5} x \right )} \]