80.9.3 problem 3

Internal problem ID [18515]
Book : Elementary Differential Equations. By Thornton C. Fry. D Van Nostrand. NY. First Edition (1929)
Section : Chapter VII. Linear equations of order higher than the first. section 63. Problems at page 196
Problem number : 3
Date solved : Thursday, March 13, 2025 at 12:11:26 PM
CAS classification : [[_3rd_order, _linear, _nonhomogeneous]]

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

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