23.3.10 problem 10

Internal problem ID [5724]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 10
Date solved : Tuesday, September 30, 2025 at 02:02:07 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y+y^{\prime \prime }&=8 \cos \left (x \right ) \cos \left (2 x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 26
ode:=y(x)+diff(diff(y(x),x),x) = 8*cos(x)*cos(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -2 \cos \left (x \right )^{3}+\left (c_1 +3\right ) \cos \left (x \right )+2 \sin \left (x \right ) \left (x +\frac {c_2}{2}\right ) \]
Mathematica. Time used: 0.079 (sec). Leaf size: 30
ode=y[x] + D[y[x],{x,2}] == 8*Cos[x]*Cos[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {1}{2} \cos (3 x)+(1+c_1) \cos (x)+(2 x+c_2) \sin (x) \end{align*}
Sympy. Time used: 0.407 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - 8*cos(x)*cos(2*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{2} \cos {\left (x \right )} + \left (C_{1} + 2 x\right ) \sin {\left (x \right )} - \frac {\cos {\left (3 x \right )}}{2} \]