32.8.19 problem Exercise 21.24, page 231

Internal problem ID [5968]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 4. Higher order linear differential equations. Lesson 21. Undetermined Coefficients
Problem number : Exercise 21.24, page 231
Date solved : Monday, January 27, 2025 at 01:29:23 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

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

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

Solution by Mathematica

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

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