38.4.6 problem 6

Internal problem ID [6492]
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 : 6
Date solved : Wednesday, March 05, 2025 at 12:52:11 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }-y^{\prime }+10 y&=20-{\mathrm e}^{2 x} \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 38
ode:=diff(diff(y(x),x),x)-diff(y(x),x)+10*y(x) = 20-exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{\frac {x}{2}} \sin \left (\frac {\sqrt {39}\, x}{2}\right ) c_2 +{\mathrm e}^{\frac {x}{2}} \cos \left (\frac {\sqrt {39}\, x}{2}\right ) c_1 +2-\frac {{\mathrm e}^{2 x}}{12} \]
Mathematica. Time used: 0.988 (sec). Leaf size: 58
ode=D[y[x],{x,2}]-D[y[x],x]+10*y[x]==20-Exp[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {e^{2 x}}{12}+c_2 e^{x/2} \cos \left (\frac {\sqrt {39} x}{2}\right )+c_1 e^{x/2} \sin \left (\frac {\sqrt {39} x}{2}\right )+2 \]
Sympy. Time used: 0.230 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(10*y(x) + exp(2*x) - Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 20,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} \sin {\left (\frac {\sqrt {39} x}{2} \right )} + C_{2} \cos {\left (\frac {\sqrt {39} x}{2} \right )}\right ) e^{\frac {x}{2}} - \frac {e^{2 x}}{12} + 2 \]