75.17.24 problem 574

Internal problem ID [17073]
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 : 574
Date solved : Tuesday, January 28, 2025 at 09:49:24 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.004 (sec). Leaf size: 32

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

Solution by Mathematica

Time used: 0.508 (sec). Leaf size: 74

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