38.4.3 problem 3

Internal problem ID [6489]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 25. Second order differential equations. Further problems 25. page 1094
Problem number : 3
Date solved : Sunday, March 30, 2025 at 11:05:26 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 29
ode:=diff(diff(y(x),x),x)-5*diff(y(x),x)+6*y(x) = 100*sin(4*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{3 x} c_2 +{\mathrm e}^{2 x} c_1 +4 \cos \left (4 x \right )-2 \sin \left (4 x \right ) \]
Mathematica. Time used: 0.02 (sec). Leaf size: 33
ode=D[y[x],{x,2}]-5*D[y[x],x]+6*y[x]==100*Sin[4*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -2 \sin (4 x)+4 \cos (4 x)+e^{2 x} \left (c_2 e^x+c_1\right ) \]
Sympy. Time used: 0.207 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(6*y(x) - 100*sin(4*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_{1} e^{2 x} + C_{2} e^{3 x} - 2 \sin {\left (4 x \right )} + 4 \cos {\left (4 x \right )} \]