9.15.12 problem 13

Internal problem ID [3216]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 24, page 109
Problem number : 13
Date solved : Tuesday, September 30, 2025 at 06:28:24 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-y&=x \sin \left (2 x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 28
ode:=diff(diff(y(x),x),x)-y(x) = x*sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} c_2 +{\mathrm e}^{-x} c_1 -\frac {4 \cos \left (2 x \right )}{25}-\frac {x \sin \left (2 x \right )}{5} \]
Mathematica. Time used: 0.011 (sec). Leaf size: 37
ode=D[y[x],{x,2}]-y[x]==x*Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {1}{5} x \sin (2 x)-\frac {4}{25} \cos (2 x)+c_1 e^x+c_2 e^{-x} \end{align*}
Sympy. Time used: 0.061 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*sin(2*x) - y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- x} + C_{2} e^{x} - \frac {x \sin {\left (2 x \right )}}{5} - \frac {4 \cos {\left (2 x \right )}}{25} \]