83.44.12 problem Ex 12 page 46

Internal problem ID [19469]
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 12 page 46
Date solved : Monday, March 31, 2025 at 07:19:35 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 29
ode:=diff(diff(y(x),x),x)-2*diff(y(x),x)+y(x) = x^2*exp(3*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (\left (x^{2}-2 x +\frac {3}{2}\right ) {\mathrm e}^{2 x}+4 c_1 x +4 c_2 \right ) {\mathrm e}^{x}}{4} \]
Mathematica. Time used: 0.019 (sec). Leaf size: 36
ode=D[y[x],{x,2}]-2*D[y[x],x]+y[x]==x^2*Exp[3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{8} e^{3 x} \left (2 x^2-4 x+3\right )+e^x (c_2 x+c_1) \]
Sympy. Time used: 0.296 (sec). Leaf size: 31
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*exp(3*x) + y(x) - 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + x \left (C_{2} - \frac {e^{2 x}}{2}\right ) + \frac {\left (2 x^{2} + 3\right ) e^{2 x}}{8}\right ) e^{x} \]