20.9.24 problem Problem 24

Internal problem ID [3768]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 8, Linear differential equations of order n. Section 8.7, The Variation of Parameters Method. page 556
Problem number : Problem 24
Date solved : Sunday, March 30, 2025 at 02:07:47 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 41
ode:=diff(diff(y(x),x),x)+5*diff(y(x),x)+4*y(x) = F(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{-4 x} \left (\left (\int {\mathrm e}^{x} F \left (x \right )d x +3 c_1 \right ) {\mathrm e}^{3 x}-\int F \left (x \right ) {\mathrm e}^{4 x}d x +3 c_2 \right )}{3} \]
Mathematica. Time used: 0.058 (sec). Leaf size: 66
ode=D[y[x],{x,2}]+5*D[y[x],x]+4*y[x]==F[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-4 x} \left (\int _1^x-\frac {1}{3} e^{4 K[1]} F(K[1])dK[1]+e^{3 x} \int _1^x\frac {1}{3} e^{K[2]} F(K[2])dK[2]+c_2 e^{3 x}+c_1\right ) \]
Sympy. Time used: 0.862 (sec). Leaf size: 36
from sympy import * 
x = symbols("x") 
y = Function("y") 
F = Function("F") 
ode = Eq(-F(x) + 4*y(x) + 5*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \left (C_{2} - \frac {\int F{\left (x \right )} e^{4 x}\, dx}{3}\right ) e^{- 3 x} + \frac {\int F{\left (x \right )} e^{x}\, dx}{3}\right ) e^{- x} \]