6.19.73 problem section 9.3, problem 73

Internal problem ID [2220]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 9 Introduction to Linear Higher Order Equations. Section 9.3. Undetermined Coefficients for Higher Order Equations. Page 495
Problem number : section 9.3, problem 73
Date solved : Tuesday, September 30, 2025 at 05:25:08 AM
CAS classification : [[_3rd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime \prime }+2 y^{\prime \prime }+y^{\prime }+2 y&=30 \cos \left (x \right )-10 \sin \left (x \right ) \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=3 \\ y^{\prime }\left (0\right )&=-4 \\ y^{\prime \prime }\left (0\right )&=16 \\ \end{align*}
Maple. Time used: 0.030 (sec). Leaf size: 25
ode:=diff(diff(diff(y(x),x),x),x)+2*diff(diff(y(x),x),x)+diff(y(x),x)+2*y(x) = 30*cos(x)-10*sin(x); 
ic:=[y(0) = 3, D(y)(0) = -4, (D@@2)(y)(0) = 16]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = {\mathrm e}^{-2 x}+\left (-x +2\right ) \cos \left (x \right )+\left (7 x -1\right ) \sin \left (x \right ) \]
Mathematica. Time used: 0.055 (sec). Leaf size: 26
ode=0*D[y[x],{x,4}]+1*D[y[x],{x,3}]+2*D[y[x],{x,2}]+1*D[y[x],x]+2*y[x]==30*Cos[x]-10*Sin[x]; 
ic={y[0]==3,Derivative[1][y][0] ==-4,Derivative[2][y][0] ==16}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-2 x}+(7 x-1) \sin (x)-((x-2) \cos (x)) \end{align*}
Sympy. Time used: 0.160 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*y(x) + 10*sin(x) - 30*cos(x) + Derivative(y(x), x) + 2*Derivative(y(x), (x, 2)) + Derivative(y(x), (x, 3)),0) 
ics = {y(0): 3, Subs(Derivative(y(x), x), x, 0): -4, Subs(Derivative(y(x), (x, 2)), x, 0): 16} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (2 - x\right ) \cos {\left (x \right )} + \left (7 x - 1\right ) \sin {\left (x \right )} + e^{- 2 x} \]