23.3.13 problem 13

Internal problem ID [5727]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 13
Date solved : Tuesday, September 30, 2025 at 02:02:10 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y+y^{\prime \prime }&=\sin \left (a x \right ) \sin \left (b x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 82
ode:=y(x)+diff(diff(y(x),x),x) = sin(a*x)*sin(b*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (x \right ) c_2 +\cos \left (x \right ) c_1 +\frac {-\left (b +1+a \right ) \left (b -1+a \right ) \cos \left (x \left (a -b \right )\right )+\cos \left (x \left (a +b \right )\right ) \left (-b +1+a \right ) \left (-b -1+a \right )}{2 a^{4}+\left (-4 b^{2}-4\right ) a^{2}+2 b^{4}-4 b^{2}+2} \]
Mathematica. Time used: 0.335 (sec). Leaf size: 159
ode=y[x] + D[y[x],{x,2}] == Sin[a*x]*Sin[b*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {a^4 c_2 \sin (x)-2 a^2 b^2 c_2 \sin (x)-a^2 \sin (a x) \sin (b x)-2 a^2 c_2 \sin (x)+c_1 \left (a^4-2 a^2 \left (b^2+1\right )+\left (b^2-1\right )^2\right ) \cos (x)-b^2 \sin (a x) \sin (b x)+\sin (a x) \sin (b x)-2 a b \cos (a x) \cos (b x)+b^4 c_2 \sin (x)-2 b^2 c_2 \sin (x)+c_2 \sin (x)}{(a-b-1) (a-b+1) (a+b-1) (a+b+1)} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(y(x) - sin(a*x)*sin(b*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out