69.17.36 problem 586

Internal problem ID [18372]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 2 (Higher order ODEs). Section 15.3 Nonhomogeneous linear equations with constant coefficients. Superposition principle. Exercises page 137
Problem number : 586
Date solved : Thursday, October 02, 2025 at 03:11:04 PM
CAS classification : [[_3rd_order, _missing_y]]

\begin{align*} y^{\prime \prime \prime }-y^{\prime \prime }-2 y^{\prime }&=4 x +3 \sin \left (x \right )+\cos \left (x \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 28
ode:=diff(diff(diff(y(x),x),x),x)-diff(diff(y(x),x),x)-2*diff(y(x),x) = 4*x+3*sin(x)+cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -{\mathrm e}^{-x} c_1 +\frac {{\mathrm e}^{2 x} c_2}{2}-x^{2}+\cos \left (x \right )+x +c_3 \]
Mathematica. Time used: 10.425 (sec). Leaf size: 101
ode=D[y[x],{x,3}]-D[y[x],{x,2}]-2*D[y[x],x]==4*x+2*Sin[x]+Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \int _1^xe^{-K[3]} \left (c_1+e^{3 K[3]} c_2+\int _1^{K[3]}-\frac {1}{3} e^{K[1]} (\cos (K[1])+4 K[1]+2 \sin (K[1]))dK[1]+e^{3 K[3]} \int _1^{K[3]}\frac {1}{3} e^{-2 K[2]} (\cos (K[2])+4 K[2]+2 \sin (K[2]))dK[2]\right )dK[3]+c_3 \end{align*}
Sympy. Time used: 0.148 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*x - 3*sin(x) - cos(x) - 2*Derivative(y(x), x) - Derivative(y(x), (x, 2)) + Derivative(y(x), (x, 3)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} + C_{2} e^{- x} + C_{3} e^{2 x} - x^{2} + x + \cos {\left (x \right )} \]