15.11.12 problem 12

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

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

Maple. Time used: 0.003 (sec). Leaf size: 29
ode:=-2*diff(diff(y(x),x),x)+3*y(x) = x*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{\frac {\sqrt {6}\, x}{2}} c_2 +{\mathrm e}^{-\frac {\sqrt {6}\, x}{2}} c_1 +\left (x +4\right ) {\mathrm e}^{x} \]
Mathematica. Time used: 0.026 (sec). Leaf size: 54
ode=D[y[x],{x,2}]-3*D[y[x],x]+3*y[x]==x*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^x \left (x+c_2 e^{x/2} \cos \left (\frac {\sqrt {3} x}{2}\right )+c_1 e^{x/2} \sin \left (\frac {\sqrt {3} x}{2}\right )+1\right ) \]
Sympy. Time used: 0.103 (sec). Leaf size: 36
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*exp(x) + 3*y(x) - 2*Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- \frac {\sqrt {6} x}{2}} + C_{2} e^{\frac {\sqrt {6} x}{2}} + x e^{x} + 4 e^{x} \]