1.11.38 problem 39

Internal problem ID [359]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 2. Linear Equations of Higher Order. Section 2.5 (Nonhomogeneous equations and undetermined coefficients). Problems at page 161
Problem number : 39
Date solved : Tuesday, September 30, 2025 at 03:57:46 AM
CAS classification : [[_3rd_order, _missing_y]]

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

With initial conditions

\begin{align*} y \left (0\right )&=1 \\ y^{\prime }\left (0\right )&=0 \\ y^{\prime \prime }\left (0\right )&=1 \\ \end{align*}
Maple. Time used: 0.033 (sec). Leaf size: 27
ode:=diff(diff(diff(y(x),x),x),x)+diff(diff(y(x),x),x) = x+exp(-x); 
ic:=[y(0) = 1, D(y)(0) = 0, (D@@2)(y)(0) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -3+\left (x +4\right ) {\mathrm e}^{-x}+\frac {x^{3}}{6}-\frac {x^{2}}{2}+3 x \]
Mathematica. Time used: 0.139 (sec). Leaf size: 32
ode=D[y[x],{x,3}]+D[y[x],{x,2}]==x+Exp[-x]; 
ic={y[0]==1,Derivative[1][y][0] ==0,Derivative[2][y][0] ==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{6} \left (x^3-3 x^2+12 x-12\right )+e^{-x} (x+3) \end{align*}
Sympy. Time used: 0.090 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x + Derivative(y(x), (x, 2)) + Derivative(y(x), (x, 3)) - exp(-x),0) 
ics = {y(0): 1, Subs(Derivative(y(x), x), x, 0): 0, Subs(Derivative(y(x), (x, 2)), x, 0): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x^{3}}{6} - \frac {x^{2}}{2} + x \left (3 + e^{- x}\right ) - 3 + 4 e^{- x} \]