15.11.3 problem 3

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

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

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