62.29.1 problem Ex 1

Internal problem ID [12873]
Book : An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section : Chapter VII, Linear differential equations with constant coefficients. Article 52. Summary. Page 117
Problem number : Ex 1
Date solved : Wednesday, March 05, 2025 at 08:49:21 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.005 (sec). Leaf size: 28
ode:=diff(diff(y(x),x),x)-5*diff(y(x),x)+6*y(x) = cos(x)-exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_{1} +x +1\right ) {\mathrm e}^{2 x}+{\mathrm e}^{3 x} c_{2} +\frac {\cos \left (x \right )}{10}-\frac {\sin \left (x \right )}{10} \]
Mathematica. Time used: 0.24 (sec). Leaf size: 70
ode=D[y[x],{x,2}]-5*D[y[x],x]+6*y[x]==Cos[x]-Exp[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{2 x} \left (\int _1^x\left (1-e^{-2 K[1]} \cos (K[1])\right )dK[1]+e^x \int _1^xe^{-3 K[2]} \left (\cos (K[2])-e^{2 K[2]}\right )dK[2]+c_2 e^x+c_1\right ) \]
Sympy. Time used: 0.241 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(6*y(x) + exp(2*x) - cos(x) - 5*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{2} e^{3 x} + \left (C_{1} + x\right ) e^{2 x} - \frac {\sin {\left (x \right )}}{10} + \frac {\cos {\left (x \right )}}{10} \]