40.11.2 problem 27

Internal problem ID [6736]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 16. Linear equations with constant coefficients (Short methods). Supplemetary problems. Page 107
Problem number : 27
Date solved : Sunday, March 30, 2025 at 11:21:00 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

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