69.16.9 problem 482

Internal problem ID [18269]
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 : 482
Date solved : Thursday, October 02, 2025 at 03:09:58 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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