71.9.14 problem 16

Internal problem ID [14422]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 4. N-th Order Linear Differential Equations. Exercises 4.1, page 186
Problem number : 16
Date solved : Monday, March 31, 2025 at 12:26:45 PM
CAS classification : [[_2nd_order, _missing_x]]

\begin{align*} y^{\prime \prime }-4 y&=31 \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=-9\\ y^{\prime }\left (0\right )&=6 \end{align*}

Maple. Time used: 0.042 (sec). Leaf size: 18
ode:=diff(diff(y(x),x),x)-4*y(x) = 31; 
ic:=y(0) = -9, D(y)(0) = 6; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\frac {17 \,{\mathrm e}^{-2 x}}{8}+\frac {7 \,{\mathrm e}^{2 x}}{8}-\frac {31}{4} \]
Mathematica. Time used: 0.014 (sec). Leaf size: 25
ode=D[y[x],{x,2}]-4*y[x]==31; 
ic={y[0]==-9,Derivative[1][y][0] ==6}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{8} \left (-17 e^{-2 x}+7 e^{2 x}-62\right ) \]
Sympy. Time used: 0.122 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*y(x) + Derivative(y(x), (x, 2)) - 31,0) 
ics = {y(0): -9, Subs(Derivative(y(x), x), x, 0): 6} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {7 e^{2 x}}{8} - \frac {31}{4} - \frac {17 e^{- 2 x}}{8} \]