88.9.2 problem 2

Internal problem ID [24022]
Book : Elementary Differential Equations. By Lee Roy Wilcox and Herbert J. Curtis. 1961 first edition. International texbook company. Scranton, Penn. USA. CAT number 61-15976
Section : Chapter 2. Differential equations of first order. Exercise at page 48
Problem number : 2
Date solved : Thursday, October 02, 2025 at 09:54:28 PM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }-2 y&=\cos \left (3 x \right ) \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 23
ode:=diff(y(x),x)-2*y(x) = cos(3*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {2 \cos \left (3 x \right )}{13}+\frac {3 \sin \left (3 x \right )}{13}+{\mathrm e}^{2 x} c_1 \]
Mathematica. Time used: 0.027 (sec). Leaf size: 24
ode=D[y[x],{x,1}] -2*y[x]==cos(3*x); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {3}{4} (2 x+1) \cos +c_1 e^{2 x} \end{align*}
Sympy. Time used: 0.080 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*y(x) - cos(3*x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{2 x} + \frac {3 \sin {\left (3 x \right )}}{13} - \frac {2 \cos {\left (3 x \right )}}{13} \]