28.2.33 problem 33

Internal problem ID [4476]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 4. Linear Differential Equations. Page 183
Problem number : 33
Date solved : Monday, January 27, 2025 at 09:20:31 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.002 (sec). Leaf size: 24

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

Solution by Mathematica

Time used: 0.027 (sec). Leaf size: 27

DSolve[D[y[x],{x,2}]+4*y[x]==8*Sin[x]^2,y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to (-1+c_1) \cos (2 x)+(-x+c_2) \sin (2 x)+1 \]