39.5.6 problem Problem 24.28

Internal problem ID [6548]
Book : Schaums Outline Differential Equations, 4th edition. Bronson and Costa. McGraw Hill 2014
Section : Chapter 24. Solutions of linear DE by Laplace transforms. Supplementary Problems. page 248
Problem number : Problem 24.28
Date solved : Sunday, March 30, 2025 at 11:07:05 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Using Laplace method With initial conditions

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

Maple. Time used: 0.098 (sec). Leaf size: 20
ode:=diff(diff(y(x),x),x)-y(x) = exp(x); 
ic:=y(0) = 1, D(y)(0) = 0; 
dsolve([ode,ic],y(x),method='laplace');
 
\[ y = \frac {3 \,{\mathrm e}^{-x}}{4}+\frac {{\mathrm e}^{x} \left (2 x +1\right )}{4} \]
Mathematica. Time used: 0.019 (sec). Leaf size: 27
ode=D[y[x],{x,2}]-y[x]==Exp[x]; 
ic={y[0]==1,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{4} e^{-x} \left (e^{2 x} (2 x+1)+3\right ) \]
Sympy. Time used: 0.134 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x) - exp(x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): 1, Subs(Derivative(y(x), x), x, 0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (\frac {x}{2} + \frac {1}{4}\right ) e^{x} + \frac {3 e^{- x}}{4} \]