20.1.32 problem Problem 40

Internal problem ID [3589]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.2, Basic Ideas and Terminology. page 21
Problem number : Problem 40
Date solved : Sunday, March 30, 2025 at 01:53:34 AM
CAS classification : [[_2nd_order, _quadrature]]

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

With initial conditions

\begin{align*} y \left (0\right )&=3\\ y^{\prime }\left (0\right )&=4 \end{align*}

Maple. Time used: 0.022 (sec). Leaf size: 15
ode:=diff(diff(y(x),x),x) = x*exp(x); 
ic:=y(0) = 3, D(y)(0) = 4; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \left (x -2\right ) {\mathrm e}^{x}+5 x +5 \]
Mathematica. Time used: 0.016 (sec). Leaf size: 18
ode=D[y[x],{x,2}]==x*Exp[x]; 
ic={y[0]==3,Derivative[1][y][0] ==4}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^x (x-2)+5 (x+1) \]
Sympy. Time used: 0.076 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*exp(x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): 3, Subs(Derivative(y(x), x), x, 0): 4} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x \left (e^{x} + 5\right ) - 2 e^{x} + 5 \]