83.44.7 problem Ex 7 page 40

Internal problem ID [19464]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Book Solved Excercises. Chapter III. Ordinary linear differential equations with constant coefficients
Problem number : Ex 7 page 40
Date solved : Monday, March 31, 2025 at 07:19:28 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 40
ode:=diff(diff(y(x),x),x)-4*diff(y(x),x)+y(x) = a*cos(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-\left (-2+\sqrt {3}\right ) x} c_1 +{\mathrm e}^{\left (2+\sqrt {3}\right ) x} c_2 -\frac {3 \left (\cos \left (2 x \right )+\frac {8 \sin \left (2 x \right )}{3}\right ) a}{73} \]
Mathematica. Time used: 0.025 (sec). Leaf size: 53
ode=D[y[x],{x,2}]-4*D[y[x],x]+y[x]==a*Cos[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {1}{73} a (8 \sin (2 x)+3 \cos (2 x))+c_1 e^{-\left (\left (\sqrt {3}-2\right ) x\right )}+c_2 e^{\left (2+\sqrt {3}\right ) x} \]
Sympy. Time used: 0.318 (sec). Leaf size: 46
from sympy import * 
x = symbols("x") 
a = symbols("a") 
y = Function("y") 
ode = Eq(-a*cos(2*x) + y(x) - 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{x \left (2 - \sqrt {3}\right )} + C_{2} e^{x \left (\sqrt {3} + 2\right )} - \frac {8 a \sin {\left (2 x \right )}}{73} - \frac {3 a \cos {\left (2 x \right )}}{73} \]