86.7.12 problem 14

Internal problem ID [23159]
Book : An introduction to Differential Equations. By Howard Frederick Cleaves. 1969. Oliver and Boyd publisher. ISBN 0050015044
Section : Chapter 5. Linear equations of the second order with constant coefficients. Exercise 5c at page 83
Problem number : 14
Date solved : Thursday, October 02, 2025 at 09:23:36 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} z^{\prime \prime }-4 z&=\sin \left (2 x \right ) \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 23
ode:=diff(diff(z(x),x),x)-4*z(x) = sin(2*x); 
dsolve(ode,z(x), singsol=all);
 
\[ z = {\mathrm e}^{2 x} c_2 +{\mathrm e}^{-2 x} c_1 -\frac {\sin \left (2 x \right )}{8} \]
Mathematica. Time used: 0.086 (sec). Leaf size: 30
ode=D[z[x],{x,2}]-4*z[x]==Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},z[x],x,IncludeSingularSolutions->True]
 
\begin{align*} z(x)&\to -\frac {1}{8} \sin (2 x)+c_1 e^{2 x}+c_2 e^{-2 x} \end{align*}
Sympy. Time used: 0.042 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
z = Function("z") 
ode = Eq(-z(x) - sin(2*x) + Derivative(z(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=z(x),ics=ics)
 
\[ z{\left (x \right )} = C_{1} e^{- x} + C_{2} e^{x} - \frac {\sin {\left (2 x \right )}}{5} \]