71.12.4 problem 4

Internal problem ID [14441]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 4. N-th Order Linear Differential Equations. Exercises 4.5, page 221
Problem number : 4
Date solved : Saturday, February 22, 2025 at 03:48:34 PM
CAS classification : [[_high_order, _with_linear_symmetries]]

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

With initial conditions

\begin{align*} y \left (0\right )&=0\\ y^{\prime }\left (0\right )&=0\\ y^{\prime \prime }\left (0\right )&=1\\ y^{\prime \prime \prime }\left (0\right )&=1 \end{align*}

Maple. Time used: 0.027 (sec). Leaf size: 24
ode:=diff(diff(diff(diff(y(x),x),x),x),x)+2*diff(diff(y(x),x),x)+y(x) = 3*x+4; 
ic:=y(0) = 0, D(y)(0) = 0, (D@@2)(y)(0) = 1, (D@@3)(y)(0) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = 4+\left (x -4\right ) \cos \left (x \right )+\frac {\left (-3 x -8\right ) \sin \left (x \right )}{2}+3 x \]
Mathematica. Time used: 0.004 (sec). Leaf size: 27
ode=D[y[x],{x,4}]+2*D[y[x],{x,2}]+y[x]==3*x+4; 
ic={y[0]==0,Derivative[1][y][0] ==0,Derivative[2][y][0] ==1,Derivative[3][y][0]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to 3 x-\frac {1}{2} (3 x+8) \sin (x)+(x-4) \cos (x)+4 \]
Sympy. Time used: 0.159 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-3*x + y(x) + 2*Derivative(y(x), (x, 2)) + Derivative(y(x), (x, 4)) - 4,0) 
ics = {y(0): 0, Subs(Derivative(y(x), x), x, 0): 0, Subs(Derivative(y(x), (x, 2)), x, 0): 1, Subs(Derivative(y(x), (x, 3)), x, 0): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 3 x + \left (- \frac {3 x}{2} - 4\right ) \sin {\left (x \right )} + \left (x - 4\right ) \cos {\left (x \right )} + 4 \]