15.12.5 problem 5

Internal problem ID [3149]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 20, page 90
Problem number : 5
Date solved : Sunday, March 30, 2025 at 01:19:43 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.002 (sec). Leaf size: 21
ode:=diff(diff(y(x),x),x)+y(x) = 4*sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (3 c_1 -8 \sin \left (x \right )\right ) \cos \left (x \right )}{3}+\sin \left (x \right ) c_2 \]
Mathematica. Time used: 0.016 (sec). Leaf size: 24
ode=D[y[x],{x,2}]+y[x]==4*Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {4}{3} \sin (2 x)+c_1 \cos (x)+c_2 \sin (x) \]
Sympy. Time used: 0.063 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - 4*sin(2*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (x \right )} + C_{2} \cos {\left (x \right )} - \frac {4 \sin {\left (2 x \right )}}{3} \]