64.11.17 problem 17

Internal problem ID [13388]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.3. The method of undetermined coefficients. Exercises page 151
Problem number : 17
Date solved : Wednesday, March 05, 2025 at 09:51:41 PM
CAS classification : [[_3rd_order, _missing_y]]

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

Maple. Time used: 0.003 (sec). Leaf size: 30
ode:=diff(diff(diff(y(x),x),x),x)+diff(y(x),x) = 2*x^2+4*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (-2-c_{2} \right ) \cos \left (x \right )+\left (c_{1} -2 x \right ) \sin \left (x \right )+\frac {2 x^{3}}{3}-4 x +c_{3} \]
Mathematica. Time used: 60.208 (sec). Leaf size: 82
ode=D[y[x],{x,3}]+D[y[x],x]==2*x^2+4*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \int _1^x\left (c_1 \cos (K[3])+\int _1^{K[3]}-2 \sin (K[1]) \left (K[1]^2+2 \sin (K[1])\right )dK[1] \cos (K[3])+c_2 \sin (K[3])+\sin (K[3]) \int _1^{K[3]}2 \cos (K[2]) \left (K[2]^2+2 \sin (K[2])\right )dK[2]\right )dK[3]+c_3 \]
Sympy. Time used: 0.190 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*x**2 - 4*sin(x) + Derivative(y(x), x) + Derivative(y(x), (x, 3)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} + C_{3} \cos {\left (x \right )} + \frac {2 x^{3}}{3} - 4 x + \left (C_{2} - 2 x\right ) \sin {\left (x \right )} \]