7.9.11 problem 23

Internal problem ID [259]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 2. Linear Equations of Higher Order. Section 2.2 (General solutions of linear equations). Problems at page 122
Problem number : 23
Date solved : Tuesday, March 04, 2025 at 11:06:32 AM
CAS classification : [[_2nd_order, _missing_x]]

\begin{align*} y^{\prime \prime }-2 y^{\prime }-3 y&=6 \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=3\\ y^{\prime }\left (0\right )&=11 \end{align*}

Maple. Time used: 0.008 (sec). Leaf size: 16
ode:=diff(diff(y(x),x),x)-2*diff(y(x),x)-3*y(x) = 6; 
ic:=y(0) = 3, D(y)(0) = 11; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = 4 \,{\mathrm e}^{3 x}+{\mathrm e}^{-x}-2 \]
Mathematica. Time used: 0.014 (sec). Leaf size: 19
ode=D[y[x],{x,2}]-2*D[y[x],x]-3*y[x]==6; 
ic={y[0]==3,Derivative[1][y][0] ==11}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-x}+4 e^{3 x}-2 \]
Sympy. Time used: 0.182 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-3*y(x) - 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 6,0) 
ics = {y(0): 3, Subs(Derivative(y(x), x), x, 0): 11} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 4 e^{3 x} - 2 + e^{- x} \]