75.16.67 problem 540

Internal problem ID [16961]
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. Trial and error method. Exercises page 132
Problem number : 540
Date solved : Thursday, March 13, 2025 at 09:02:58 AM
CAS classification : [[_3rd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime \prime }-y^{\prime \prime }+y^{\prime }-y&=x^{2}+x \end{align*}

Maple. Time used: 0.005 (sec). Leaf size: 26
ode:=diff(diff(diff(y(x),x),x),x)-diff(diff(y(x),x),x)+diff(y(x),x)-y(x) = x^2+x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -x^{2}-3 x -1+\cos \left (x \right ) c_{1} +{\mathrm e}^{x} c_{2} +c_{3} \sin \left (x \right ) \]
Mathematica. Time used: 0.004 (sec). Leaf size: 31
ode=D[y[x],{x,3}]-D[y[x],{x,2}]+D[y[x],x]-y[x]==x+x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -x^2-3 x+c_3 e^x+c_1 \cos (x)+c_2 \sin (x)-1 \]
Sympy. Time used: 0.148 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 - x - y(x) + 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} e^{x} + C_{2} \sin {\left (x \right )} + C_{3} \cos {\left (x \right )} - x^{2} - 3 x - 1 \]