89.18.16 problem 16

Internal problem ID [24716]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 9. Nonhomogeneous Equations: Undetermined coefficients. Oral Exercises at page 146
Problem number : 16
Date solved : Thursday, October 02, 2025 at 10:47:24 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y-2 y^{\prime }+y^{\prime \prime }&={\mathrm e}^{3 x} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 18
ode:=diff(diff(y(x),x),x)-2*diff(y(x),x)+y(x) = exp(3*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} \left (c_2 +c_1 x +\frac {{\mathrm e}^{2 x}}{4}\right ) \]
Mathematica. Time used: 0.017 (sec). Leaf size: 26
ode=D[y[x],{x,2}]-2*D[y[x],{x,1}]+y[x]==Exp[3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {e^{3 x}}{4}+e^x (c_2 x+c_1) \end{align*}
Sympy. Time used: 0.120 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - exp(3*x) - 2*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} x + \frac {e^{2 x}}{4}\right ) e^{x} \]