23.1.17 problem 2(g)

Internal problem ID [4107]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 2. First order equations. Exercises at page 14
Problem number : 2(g)
Date solved : Sunday, March 30, 2025 at 02:18:13 AM
CAS classification : [[_linear, `class A`]]

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

With initial conditions

\begin{align*} y \left (5\right )&=5 \end{align*}

Maple. Time used: 0.057 (sec). Leaf size: 26
ode:=diff(y(x),x)-3*y(x) = exp(3*x)+exp(-3*x); 
ic:=y(5) = 5; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \left (x -\frac {{\mathrm e}^{-6 x}}{6}-5+\frac {{\mathrm e}^{-30}}{6}+5 \,{\mathrm e}^{-15}\right ) {\mathrm e}^{3 x} \]
Mathematica. Time used: 0.077 (sec). Leaf size: 48
ode=D[y[x],x]-3*y[x]==Exp[3*x]+Exp[-3*x]; 
ic=y[5]==5; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{6} e^{-3 (x+10)} \left (6 e^{6 (x+5)} (x-5)+e^{6 x}+30 e^{6 x+15}-e^{30}\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-3*y(x) - exp(3*x) + Derivative(y(x), x) - exp(-3*x),0) 
ics = {y(5): 5} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -3*y(x) - 2*cosh(3*x) + Derivative(y(x), x) cannot be solved by the factorable group method