83.12.2 problem 2

Internal problem ID [22003]
Book : Differential Equations By Kaj L. Nielsen. Second edition 1966. Barnes and nobel. 66-28306
Section : Chapter VII. Operational method. Ex. XV at page 121
Problem number : 2
Date solved : Thursday, October 02, 2025 at 08:21:35 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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