34.1.10 problem 22

Internal problem ID [7865]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 2. Solutions of differential equations. Supplemetary problems. Page 11
Problem number : 22
Date solved : Tuesday, September 30, 2025 at 05:07:11 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-3 y^{\prime }+2 y&=2 \,{\mathrm e}^{x} \left (1-x \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 16
ode:=diff(diff(y(x),x),x)-3*diff(y(x),x)+2*y(x) = 2*exp(x)*(1-x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left ({\mathrm e}^{x} c_1 +x^{2}+c_2 \right ) {\mathrm e}^{x} \]
Mathematica. Time used: 0.014 (sec). Leaf size: 21
ode=D[y[x],{x,2}]-3*D[y[x],x]+2*y[x]==2*Exp[x]*(1-x); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^x \left (x^2+c_2 e^x+c_1\right ) \end{align*}
Sympy. Time used: 0.131 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((2*x - 2)*exp(x) + 2*y(x) - 3*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + C_{2} e^{x} + x^{2}\right ) e^{x} \]