32.8.17 problem Exercise 21.21, page 231

Internal problem ID [5966]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 4. Higher order linear differential equations. Lesson 21. Undetermined Coefficients
Problem number : Exercise 21.21, page 231
Date solved : Sunday, March 30, 2025 at 10:28:26 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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