15.14.12 problem 12

Internal problem ID [3184]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 23, page 106
Problem number : 12
Date solved : Sunday, March 30, 2025 at 01:20:40 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&={\mathrm e}^{3 x} \left (1+\sin \left (2 x \right )\right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 33
ode:=diff(diff(y(x),x),x)+y(x) = exp(3*x)*(1+sin(2*x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (2 \sin \left (x \right ) \cos \left (x \right )-4 \cos \left (x \right )^{2}+5\right ) {\mathrm e}^{3 x}}{30}+\cos \left (x \right ) c_1 +\sin \left (x \right ) c_2 \]
Mathematica. Time used: 0.287 (sec). Leaf size: 50
ode=D[y[x],{x,2}]+y[x]==Exp[3*x]*(1+Sin[2*x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{30} \left (3 e^{3 x}+e^{3 x} \sin (2 x)-2 e^{3 x} \cos (2 x)+30 c_1 \cos (x)+30 c_2 \sin (x)\right ) \]
Sympy. Time used: 0.136 (sec). Leaf size: 42
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-sin(2*x) - 1)*exp(3*x) + y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (x \right )} + C_{2} \cos {\left (x \right )} + \frac {e^{3 x} \sin {\left (2 x \right )}}{30} - \frac {e^{3 x} \cos {\left (2 x \right )}}{15} + \frac {e^{3 x}}{10} \]