85.53.5 problem 1 (e)

Internal problem ID [22818]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter 4. Linear differential equations. A Exercises at page 197
Problem number : 1 (e)
Date solved : Thursday, October 02, 2025 at 09:14:56 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} 4 y+y^{\prime \prime }&=8 \cos \left (2 x \right )-4 x \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 26
ode:=diff(diff(y(x),x),x)+4*y(x) = 8*cos(2*x)-4*x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 +1\right ) \cos \left (2 x \right )+\left (c_2 +2 x \right ) \sin \left (2 x \right )-x \]
Mathematica. Time used: 0.137 (sec). Leaf size: 29
ode=D[y[x],{x,2}]+4*y[x]==8*Cos[2*x]-4*x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -x+(1+c_1) \cos (2 x)+(2 x+c_2) \sin (2 x) \end{align*}
Sympy. Time used: 0.063 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*x + 4*y(x) - 8*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 (2 x \right )} - x + \left (C_{1} + 2 x\right ) \sin {\left (2 x \right )} \]