75.18.21 problem 610

Internal problem ID [17038]
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. Initial value problem. Exercises page 140
Problem number : 610
Date solved : Monday, March 31, 2025 at 03:38:50 PM
CAS classification : [[_2nd_order, _missing_x]]

\begin{align*} y^{\prime \prime }-y&=1 \end{align*}

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