85.4.2 problem 1 (b)

Internal problem ID [22443]
Book : Applied Differential Equations. By Murray R. Spiegel. 3rd edition. 1980. Pearson. ISBN 978-0130400970
Section : Chapter 1. Differential equations in general. Section 1.3. A Exercises at page 21
Problem number : 1 (b)
Date solved : Thursday, October 02, 2025 at 08:39:32 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

With initial conditions

\begin{align*} y \left (0\right )&=2 \\ y^{\prime }\left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.012 (sec). Leaf size: 18
ode:=diff(diff(y(x),x),x)-y(x) = 4*x; 
ic:=[y(0) = 2, D(y)(0) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -{\mathrm e}^{-x}+3 \,{\mathrm e}^{x}-4 x \]
Mathematica. Time used: 0.008 (sec). Leaf size: 21
ode=D[y[x],{x,2}]-y[x]==4*x; 
ic={y[0]==2,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -4 x-e^{-x}+3 e^x \end{align*}
Sympy. Time used: 0.043 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*x - y(x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): 2, Subs(Derivative(y(x), x), x, 0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - 4 x + 3 e^{x} - e^{- x} \]