39.5.7 problem Problem 24.29

Internal problem ID [6549]
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.29
Date solved : Sunday, March 30, 2025 at 11:07:06 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+2 y^{\prime }-3 y&=\sin \left (2 x \right ) \end{align*}

Using Laplace method With initial conditions

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

Maple. Time used: 0.095 (sec). Leaf size: 27
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)-3*y(x) = sin(2*x); 
ic:=y(0) = 0, D(y)(0) = 0; 
dsolve([ode,ic],y(x),method='laplace');
 
\[ y = -\frac {4 \cos \left (2 x \right )}{65}-\frac {7 \sin \left (2 x \right )}{65}-\frac {{\mathrm e}^{-3 x}}{26}+\frac {{\mathrm e}^{x}}{10} \]
Mathematica. Time used: 0.101 (sec). Leaf size: 36
ode=D[y[x],{x,2}]-2*D[y[x],x]-3*y[x]==Sin[2*x]; 
ic={y[0]==0,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{130} \left (-13 e^{-x}+5 e^{3 x}-14 \sin (2 x)+8 \cos (2 x)\right ) \]
Sympy. Time used: 0.260 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-3*y(x) - sin(2*x) + 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): 0, Subs(Derivative(y(x), x), x, 0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {e^{x}}{10} - \frac {7 \sin {\left (2 x \right )}}{65} - \frac {4 \cos {\left (2 x \right )}}{65} - \frac {e^{- 3 x}}{26} \]