84.27.1 problem 16.1

Internal problem ID [22274]
Book : Schaums outline series. Differential Equations By Richard Bronson. 1973. McGraw-Hill Inc. ISBN 0-07-008009-7
Section : Chapter 16. Initial-value problems. Solved problems. Page 81
Problem number : 16.1
Date solved : Thursday, October 02, 2025 at 08:36:58 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

With initial conditions

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