75.16.5 problem 478

Internal problem ID [16907]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 2 (Higher order ODEs). Section 15.3 Nonhomogeneous linear equations with constant coefficients. Trial and error method. Exercises page 132
Problem number : 478
Date solved : Monday, March 31, 2025 at 03:35:11 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-8 y^{\prime }+16 y&=\left (1-x \right ) {\mathrm e}^{4 x} \end{align*}

Maple. Time used: 0.004 (sec). Leaf size: 29
ode:=diff(diff(y(x),x),x)-8*diff(y(x),x)+16*y(x) = (1-x)*exp(4*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\left (x^{3}-3 x^{2}+\left (-6 c_1 +2\right ) x -6 c_2 \right ) {\mathrm e}^{4 x}}{6} \]
Mathematica. Time used: 0.026 (sec). Leaf size: 34
ode=D[y[x],{x,2}]-8*D[y[x],x]+16*y[x]==(1-x)*Exp[4*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{6} e^{4 x} \left (-x^3+3 x^2+6 c_2 x+6 c_1\right ) \]
Sympy. Time used: 0.264 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(1 - x)*exp(4*x) + 16*y(x) - 8*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 {x^{2}}{6} + \frac {x}{2}\right )\right ) e^{4 x} \]