40.11.13 problem 39

Internal problem ID [6747]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 16. Linear equations with constant coefficients (Short methods). Supplemetary problems. Page 107
Problem number : 39
Date solved : Sunday, March 30, 2025 at 11:21:18 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-y&=x \,{\mathrm e}^{3 x} \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 26
ode:=diff(diff(y(x),x),x)-y(x) = x*exp(3*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} c_2 +{\mathrm e}^{-x} c_1 +\frac {\left (4 x -3\right ) {\mathrm e}^{3 x}}{32} \]
Mathematica. Time used: 0.019 (sec). Leaf size: 34
ode=D[y[x],{x,2}]-y[x]==x*Exp[3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{32} e^{3 x} (4 x-3)+c_1 e^x+c_2 e^{-x} \]
Sympy. Time used: 0.173 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*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} e^{- x} + C_{2} e^{x} + \frac {\left (4 x - 3\right ) e^{3 x}}{32} \]