1.11.23 problem 23

Internal problem ID [344]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 2. Linear Equations of Higher Order. Section 2.5 (Nonhomogeneous equations and undetermined coefficients). Problems at page 161
Problem number : 23
Date solved : Tuesday, September 30, 2025 at 03:57:35 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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