82.33.5 problem Ex. 5

Internal problem ID [18819]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter VI. Linear equations with constant coefficients. Examples on chapter VI, page 80
Problem number : Ex. 5
Date solved : Thursday, March 13, 2025 at 01:00:00 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }-5 y^{\prime }+6 y&=x +{\mathrm e}^{m x} \end{align*}

Maple. Time used: 0.006 (sec). Leaf size: 70
ode:=diff(diff(y(x),x),x)-5*diff(y(x),x)+6*y(x) = x+exp(m*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {36 c_{2} \left (m -2\right ) \left (m -3\right ) {\mathrm e}^{2 x}+36 c_{1} \left (m -2\right ) \left (m -3\right ) {\mathrm e}^{3 x}+36 \,{\mathrm e}^{m x}+\left (6 x +5\right ) m^{2}+\left (-30 x -25\right ) m +36 x +30}{36 m^{2}-180 m +216} \]
Mathematica. Time used: 0.233 (sec). Leaf size: 58
ode=D[y[x],{x,2}]-5*D[y[x],x]+6*y[x]==x+Exp[m*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\left (m^2-5 m+6\right ) (6 x+5)+36 e^{m x}}{36 (m-3) (m-2)}+c_1 e^{2 x}+c_2 e^{3 x} \]
Sympy. Time used: 0.249 (sec). Leaf size: 36
from sympy import * 
x = symbols("x") 
m = symbols("m") 
y = Function("y") 
ode = Eq(-x + 6*y(x) - exp(m*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} + \frac {x}{6} + \frac {5}{36} + \frac {e^{m x}}{m^{2} - 5 m + 6} \]