64.5.32 problem 35 (b)

Internal problem ID [13274]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 2, section 2.3 (Linear equations). Exercises page 56
Problem number : 35 (b)
Date solved : Monday, March 31, 2025 at 07:44:48 AM
CAS classification : [[_linear, `class A`]]

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

Maple. Time used: 0.001 (sec). Leaf size: 27
ode:=diff(y(x),x)+y(x) = 2*sin(x)+5*sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (x \right )+\sin \left (2 x \right )-\cos \left (x \right )-2 \cos \left (2 x \right )+{\mathrm e}^{-x} c_1 \]
Mathematica. Time used: 0.109 (sec). Leaf size: 37
ode=D[y[x],x]+y[x]==2*Sin[x]+5*Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-x} \left (\int _1^x2 e^{K[1]} (5 \cos (K[1])+1) \sin (K[1])dK[1]+c_1\right ) \]
Sympy. Time used: 0.182 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - 2*sin(x) - 5*sin(2*x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- x} + \sin {\left (x \right )} + \sin {\left (2 x \right )} - \cos {\left (x \right )} - 2 \cos {\left (2 x \right )} \]