75.17.22 problem 572

Internal problem ID [17071]
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. Superposition principle. Exercises page 137
Problem number : 572
Date solved : Tuesday, January 28, 2025 at 09:49:17 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.006 (sec). Leaf size: 31

dsolve(diff(y(x),x$2)+4*y(x)=exp(x)+4*sin(2*x)+2*cos(x)^2-1,y(x), singsol=all)
 
\[ y = \frac {\left (2+x +4 c_{2} \right ) \sin \left (2 x \right )}{4}+\left (-x +c_{1} \right ) \cos \left (2 x \right )+\frac {{\mathrm e}^{x}}{5} \]

Solution by Mathematica

Time used: 0.379 (sec). Leaf size: 96

DSolve[D[y[x],{x,2}]+4*y[x]==Exp[x]+4*Sin[2*x]+2*Cos[x]^2-1,y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \cos (2 x) \int _1^x-\frac {1}{2} \sin (2 K[1]) \left (\cos (2 K[1])+e^{K[1]}+4 \sin (2 K[1])\right )dK[1]+\sin (2 x) \int _1^x\frac {1}{2} \cos (2 K[2]) \left (\cos (2 K[2])+e^{K[2]}+4 \sin (2 K[2])\right )dK[2]+c_1 \cos (2 x)+c_2 \sin (2 x) \]