23.3.20 problem 20

Internal problem ID [5734]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 20
Date solved : Tuesday, September 30, 2025 at 02:02:15 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y+y^{\prime \prime }&={\mathrm e}^{2 x} \cos \left (x \right ) \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 24
ode:=y(x)+diff(diff(y(x),x),x) = exp(2*x)*cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (x \right ) c_2 +\cos \left (x \right ) c_1 +\frac {{\mathrm e}^{2 x} \left (\cos \left (x \right )+\sin \left (x \right )\right )}{8} \]
Mathematica. Time used: 0.036 (sec). Leaf size: 36
ode=y[x] + D[y[x],{x,2}] == E^(2*x)*Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{8} \left (\left (e^{2 x}+8 c_1\right ) \cos (x)+\left (e^{2 x}+8 c_2\right ) \sin (x)\right ) \end{align*}
Sympy. Time used: 0.070 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - exp(2*x)*cos(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \frac {e^{2 x}}{8}\right ) \sin {\left (x \right )} + \left (C_{2} + \frac {e^{2 x}}{8}\right ) \cos {\left (x \right )} \]