73.15.41 problem 22.10 (n)

Internal problem ID [15401]
Book : Ordinary Differential Equations. An introduction to the fundamentals. Kenneth B. Howell. second edition. CRC Press. FL, USA. 2020
Section : Chapter 22. Method of undetermined coefficients. Additional exercises page 412
Problem number : 22.10 (n)
Date solved : Monday, March 31, 2025 at 01:36:38 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.002 (sec). Leaf size: 23
ode:=diff(diff(y(x),x),x)+y(x) = 6*cos(2*x)-3*sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (x \right ) c_2 +\cos \left (x \right ) c_1 +\sin \left (2 x \right )-2 \cos \left (2 x \right ) \]
Mathematica. Time used: 0.015 (sec). Leaf size: 26
ode=D[y[x],{x,2}]+y[x]==6*Cos[2*x]-3*Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \sin (2 x)-2 \cos (2 x)+c_1 \cos (x)+c_2 \sin (x) \]
Sympy. Time used: 0.083 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + 3*sin(2*x) - 6*cos(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 )} + \sin {\left (2 x \right )} - 2 \cos {\left (2 x \right )} \]