15.11.31 problem 31

Internal problem ID [3141]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 19, page 86
Problem number : 31
Date solved : Sunday, March 30, 2025 at 01:19:28 AM
CAS classification : [[_2nd_order, _missing_y]]

\begin{align*} 2 y^{\prime \prime }+y^{\prime }&=8 \sin \left (2 x \right )+{\mathrm e}^{-x} \end{align*}

With initial conditions

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

Maple. Time used: 0.031 (sec). Leaf size: 28
ode:=2*diff(diff(y(x),x),x)+diff(y(x),x) = 8*sin(2*x)+exp(-x); 
ic:=y(0) = 1, D(y)(0) = 0; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = -\frac {98 \,{\mathrm e}^{-\frac {x}{2}}}{17}-\frac {16 \sin \left (2 x \right )}{17}+{\mathrm e}^{-x}-\frac {4 \cos \left (2 x \right )}{17}+6 \]
Mathematica. Time used: 0.419 (sec). Leaf size: 39
ode=2*D[y[x],{x,2}]+D[y[x],x]==8*Sin[2*x]+Exp[-x]; 
ic={y[0]==1,Derivative[1][y][0] ==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-x}-\frac {98 e^{-x/2}}{17}-\frac {16}{17} \sin (2 x)-\frac {4}{17} \cos (2 x)+6 \]
Sympy. Time used: 0.248 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-8*sin(2*x) + Derivative(y(x), x) + 2*Derivative(y(x), (x, 2)) - exp(-x),0) 
ics = {y(0): 1, Subs(Derivative(y(x), x), x, 0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {16 \sin {\left (2 x \right )}}{17} - \frac {4 \cos {\left (2 x \right )}}{17} + 6 + e^{- x} - \frac {98 e^{- \frac {x}{2}}}{17} \]