69.1.128 problem 187

Internal problem ID [14202]
Book : DIFFERENTIAL and INTEGRAL CALCULUS. VOL I. by N. PISKUNOV. MIR PUBLISHERS, Moscow 1969.
Section : Chapter 8. Differential equations. Exercises page 595
Problem number : 187
Date solved : Wednesday, March 05, 2025 at 10:39:51 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.005 (sec). Leaf size: 33
ode:=diff(diff(y(x),x),x)-4*y(x) = exp(2*x)*sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (20 c_{2} -2 \cos \left (2 x \right )-\sin \left (2 x \right )\right ) {\mathrm e}^{2 x}}{20}+c_{1} {\mathrm e}^{-2 x} \]
Mathematica. Time used: 0.094 (sec). Leaf size: 66
ode=D[y[x],{x,2}]-4*y[x]==Exp[2*x]*Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-2 x} \left (e^{4 x} \int _1^x\frac {1}{4} \sin (2 K[1])dK[1]+\int _1^x-\frac {1}{4} e^{4 K[2]} \sin (2 K[2])dK[2]+c_1 e^{4 x}+c_2\right ) \]
Sympy. Time used: 0.146 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*y(x) - exp(2*x)*sin(2*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{2} e^{- 2 x} + \left (C_{1} - \frac {\sin {\left (2 x \right )}}{20} - \frac {\cos {\left (2 x \right )}}{10}\right ) e^{2 x} \]