28.2.57 problem 57

Internal problem ID [4500]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 4. Linear Differential Equations. Page 183
Problem number : 57
Date solved : Sunday, March 30, 2025 at 03:24:09 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 20
ode:=diff(diff(y(x),x),x)+3*diff(y(x),x)+2*y(x) = sin(exp(x)); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -{\mathrm e}^{-2 x} \left (c_1 -c_2 \,{\mathrm e}^{x}+\sin \left ({\mathrm e}^{x}\right )\right ) \]
Mathematica. Time used: 0.067 (sec). Leaf size: 26
ode=D[y[x],{x,2}]+3*D[y[x],x]+2*y[x]==Sin[Exp[x]]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-2 x} \left (-\sin \left (e^x\right )+c_2 e^x+c_1\right ) \]
Sympy. Time used: 0.592 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) - sin(exp(x)) + 3*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \left (C_{2} - \sin {\left (e^{x} \right )}\right ) e^{- x}\right ) e^{- x} \]