89.16.24 problem 24

Internal problem ID [24674]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 9. Nonhomogeneous Equations: Undetermined coefficients. Exercises at page 140
Problem number : 24
Date solved : Thursday, October 02, 2025 at 10:46:56 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-y&=10 \sin \left (x \right )^{2} \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 20
ode:=diff(diff(y(x),x),x)-y(x) = 10*sin(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{x} c_2 +{\mathrm e}^{-x} c_1 -5+\cos \left (2 x \right ) \]
Mathematica. Time used: 0.042 (sec). Leaf size: 25
ode=D[y[x],{x,2}]-y[x]== 10*Sin[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \cos (2 x)+c_1 e^x+c_2 e^{-x}-5 \end{align*}
Sympy. Time used: 0.301 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x) - 10*sin(x)**2 + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- x} + C_{2} e^{x} + \cos {\left (2 x \right )} - 5 \]