64.11.4 problem 4

Internal problem ID [13375]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.3. The method of undetermined coefficients. Exercises page 151
Problem number : 4
Date solved : Wednesday, March 05, 2025 at 09:50:09 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.002 (sec). Leaf size: 33
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+2*y(x) = 10*sin(4*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (x \right ) {\mathrm e}^{-x} c_{2} +{\mathrm e}^{-x} c_{1} \cos \left (x \right )-\frac {7 \sin \left (4 x \right )}{13}-\frac {4 \cos \left (4 x \right )}{13} \]
Mathematica. Time used: 0.022 (sec). Leaf size: 42
ode=D[y[x],{x,2}]+2*D[y[x],x]+2*y[x]==10*Sin[4*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {7}{13} \sin (4 x)-\frac {4}{13} \cos (4 x)+c_2 e^{-x} \cos (x)+c_1 e^{-x} \sin (x) \]
Sympy. Time used: 0.223 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) - 10*sin(4*x) + 2*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} \sin {\left (x \right )} + C_{2} \cos {\left (x \right )}\right ) e^{- x} - \frac {7 \sin {\left (4 x \right )}}{13} - \frac {4 \cos {\left (4 x \right )}}{13} \]