40.10.9 problem 18

Internal problem ID [6731]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 15. Linear equations with constant coefficients (Variation of parameters). Supplemetary problems. Page 98
Problem number : 18
Date solved : Sunday, March 30, 2025 at 11:20:53 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 32
ode:=diff(diff(y(x),x),x)-9*y(x) = x+exp(2*x)-sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{3 x} c_2 +{\mathrm e}^{-3 x} c_1 -\frac {{\mathrm e}^{2 x}}{5}-\frac {x}{9}+\frac {\sin \left (2 x \right )}{13} \]
Mathematica. Time used: 0.687 (sec). Leaf size: 44
ode=D[y[x],{x,2}]-9*y[x]==x+Exp[2*x]-Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {x}{9}-\frac {e^{2 x}}{5}+\frac {1}{13} \sin (2 x)+c_1 e^{3 x}+c_2 e^{-3 x} \]
Sympy. Time used: 0.167 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x - 9*y(x) - exp(2*x) + sin(2*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- 3 x} + C_{2} e^{3 x} - \frac {x}{9} - \frac {e^{2 x}}{5} + \frac {\sin {\left (2 x \right )}}{13} \]