84.23.9 problem 14.9

Internal problem ID [22253]
Book : Schaums outline series. Differential Equations By Richard Bronson. 1973. McGraw-Hill Inc. ISBN 0-07-008009-7
Section : Chapter 14. The method of undetermined coefficients. Solved problems. Page 71
Problem number : 14.9
Date solved : Thursday, October 02, 2025 at 08:36:40 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }-5 y&=x^{2} {\mathrm e}^{x}-x \,{\mathrm e}^{5 x} \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 34
ode:=diff(y(x),x)-5*y(x) = x^2*exp(x)-x*exp(5*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {{\mathrm e}^{x} \left (x^{2}-2 c_1 \right ) {\mathrm e}^{4 x}}{2}+\frac {{\mathrm e}^{x} \left (-8 x^{2}-4 x -1\right )}{32} \]
Mathematica. Time used: 0.211 (sec). Leaf size: 39
ode=D[y[x],x]-5*y[x]==x^2*Exp[x]-x*Exp[5*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {1}{32} e^x \left (8 x^2+4 x+1\right )+e^{5 x} \left (-\frac {x^2}{2}+c_1\right ) \end{align*}
Sympy. Time used: 0.137 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*exp(x) + x*exp(5*x) - 5*y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (- \frac {x^{2}}{4} - \frac {x}{8} + \left (C_{1} - \frac {x^{2}}{2}\right ) e^{4 x} - \frac {1}{32}\right ) e^{x} \]