71.14.6 problem 12

Internal problem ID [14461]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 5. The Laplace Transform Method. Exercises 5.3, page 255
Problem number : 12
Date solved : Thursday, March 13, 2025 at 03:30:51 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Using Laplace method With initial conditions

\begin{align*} y \left (0\right )&={\frac {11}{4}}\\ y^{\prime }\left (0\right )&={\frac {1}{2}} \end{align*}

Maple. Time used: 8.176 (sec). Leaf size: 26
ode:=diff(diff(y(x),x),x)-diff(y(x),x)-2*y(x) = x^2; 
ic:=y(0) = 11/4, D(y)(0) = 1/2; 
dsolve([ode,ic],y(x),method='laplace');
 
\[ y = -\frac {x^{2}}{2}+\frac {x}{2}+\frac {7 \,{\mathrm e}^{-x}}{3}-\frac {3}{4}+\frac {7 \,{\mathrm e}^{2 x}}{6} \]
Mathematica. Time used: 0.015 (sec). Leaf size: 33
ode=D[y[x],{x,2}]-D[y[x],x]-2*y[x]==x^2; 
ic={y[0]==11/4,Derivative[1][y][0] ==1/2}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{12} \left (-6 x^2+6 x+28 e^{-x}+14 e^{2 x}-9\right ) \]
Sympy. Time used: 0.201 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 - 2*y(x) - Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): 11/4, Subs(Derivative(y(x), x), x, 0): 1/2} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {x^{2}}{2} + \frac {x}{2} + \frac {7 e^{2 x}}{6} - \frac {3}{4} + \frac {7 e^{- x}}{3} \]