15.15.16 problem 17

Internal problem ID [3220]
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 : 17
Date solved : Sunday, March 30, 2025 at 01:21:37 AM
CAS classification : [[_2nd_order, _missing_y]]

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

Maple. Time used: 0.002 (sec). Leaf size: 34
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x) = x^2*exp(-x)*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{-x} \left (-\sin \left (x \right ) x^{2}-2 \cos \left (x \right ) x +\sin \left (x \right )\right )}{2}-\frac {{\mathrm e}^{-2 x} c_1}{2}+c_2 \]
Mathematica. Time used: 1.016 (sec). Leaf size: 39
ode=D[y[x],{x,2}]+2*D[y[x],x]==x^2*Exp[-x]*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to c_2-\frac {1}{2} e^{-2 x} \left (e^x \left (x^2-1\right ) \sin (x)+2 e^x x \cos (x)+c_1\right ) \]
Sympy. Time used: 0.370 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*exp(-x)*sin(x) + 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} + C_{2} e^{- 2 x} - \frac {x^{2} e^{- x} \sin {\left (x \right )}}{2} - x e^{- x} \cos {\left (x \right )} + \frac {e^{- x} \sin {\left (x \right )}}{2} \]