75.16.61 problem 534

Internal problem ID [16955]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 2 (Higher order ODEs). Section 15.3 Nonhomogeneous linear equations with constant coefficients. Trial and error method. Exercises page 132
Problem number : 534
Date solved : Thursday, March 13, 2025 at 09:02:36 AM
CAS classification : [[_2nd_order, _missing_y]]

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

Maple. Time used: 0.003 (sec). Leaf size: 32
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x) = 4*(cos(x)+sin(x))*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\left (\frac {4 \left (\cos \left (x \right )-3 \sin \left (x \right )\right ) {\mathrm e}^{3 x}}{5}-2 \,{\mathrm e}^{2 x} c_{2} +c_{1} \right ) {\mathrm e}^{-2 x}}{2} \]
Mathematica. Time used: 5.554 (sec). Leaf size: 48
ode=D[y[x],{x,2}]+2*D[y[x],x]==4*Exp[x]*(Sin[x]+Cos[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \int _1^xe^{-2 K[2]} \left (c_1+\int _1^{K[2]}4 e^{3 K[1]} (\cos (K[1])+\sin (K[1]))dK[1]\right )dK[2]+c_2 \]
Sympy. Time used: 0.321 (sec). Leaf size: 48
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*(sin(x) + cos(x))*exp(x) + 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} + C_{2} e^{- 2 x} + \frac {2 \sqrt {2} e^{x} \sin {\left (x + \frac {\pi }{4} \right )}}{5} - \frac {4 \sqrt {2} e^{x} \cos {\left (x + \frac {\pi }{4} \right )}}{5} \]