86.10.11 problem 11

Internal problem ID [23191]
Book : An introduction to Differential Equations. By Howard Frederick Cleaves. 1969. Oliver and Boyd publisher. ISBN 0050015044
Section : Chapter 9. The operational method. Exercise 9b at page 134
Problem number : 11
Date solved : Thursday, October 02, 2025 at 09:24:11 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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