56.1.42 problem 42

Internal problem ID [8754]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 42
Date solved : Wednesday, March 05, 2025 at 06:44:21 AM
CAS classification : [[_2nd_order, _missing_x]]

\begin{align*} y^{\prime \prime }+y^{\prime }+4 y&=1 \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 32
ode:=diff(diff(y(x),x),x)+diff(y(x),x)+4*y(x) = 1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-\frac {x}{2}} \sin \left (\frac {\sqrt {15}\, x}{2}\right ) c_{2} +{\mathrm e}^{-\frac {x}{2}} \cos \left (\frac {\sqrt {15}\, x}{2}\right ) c_{1} +\frac {1}{4} \]
Mathematica. Time used: 0.029 (sec). Leaf size: 51
ode=D[y[x],{x,2}]+D[y[x],x]+4*y[x]==1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to c_2 e^{-x/2} \cos \left (\frac {\sqrt {15} x}{2}\right )+c_1 e^{-x/2} \sin \left (\frac {\sqrt {15} x}{2}\right )+\frac {1}{4} \]
Sympy. Time used: 0.168 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) + Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} \sin {\left (\frac {\sqrt {15} x}{2} \right )} + C_{2} \cos {\left (\frac {\sqrt {15} x}{2} \right )}\right ) e^{- \frac {x}{2}} + \frac {1}{4} \]