64.9.8 problem 9

Internal problem ID [13335]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.1. Basic theory of linear differential equations. Exercises page 124
Problem number : 9
Date solved : Monday, March 31, 2025 at 07:51:49 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.004 (sec). Leaf size: 25
ode:=diff(diff(y(x),x),x)-5*diff(y(x),x)+6*y(x) = 2-12*x+6*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{2 x} c_2 +{\mathrm e}^{3 x} c_1 +3 \,{\mathrm e}^{x}-2 x -\frac {4}{3} \]
Mathematica. Time used: 0.241 (sec). Leaf size: 78
ode=D[y[x],{x,2}]-5*D[y[x],x]+6*y[x]==2-12*x+6*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{2 x} \left (\int _1^x-2 e^{-2 K[1]} \left (-6 K[1]+3 e^{K[1]}+1\right )dK[1]+e^x \int _1^x2 e^{-3 K[2]} \left (-6 K[2]+3 e^{K[2]}+1\right )dK[2]+c_2 e^x+c_1\right ) \]
Sympy. Time used: 0.202 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(12*x + 6*y(x) - 6*exp(x) - 5*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 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 x + 3 e^{x} - \frac {4}{3} \]