15.13.1 problem 1

Internal problem ID [3170]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 22, page 99
Problem number : 1
Date solved : Sunday, March 30, 2025 at 01:20:18 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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