20.9.26 problem Problem 26

Internal problem ID [3770]
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 26
Date solved : Sunday, March 30, 2025 at 02:07:50 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Maple. Time used: 0.004 (sec). Leaf size: 43
ode:=diff(diff(y(x),x),x)+4*diff(y(x),x)-12*y(x) = F(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{-6 x} \left (\left (\int {\mathrm e}^{-2 x} F \left (x \right )d x +8 c_1 \right ) {\mathrm e}^{8 x}-\int F \left (x \right ) {\mathrm e}^{6 x}d x +8 c_2 \right )}{8} \]
Mathematica. Time used: 0.069 (sec). Leaf size: 68
ode=D[y[x],{x,2}]+4*D[y[x],x]-12*y[x]==F[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-6 x} \left (\int _1^x-\frac {1}{8} e^{6 K[1]} F(K[1])dK[1]+e^{8 x} \int _1^x\frac {1}{8} e^{-2 K[2]} F(K[2])dK[2]+c_2 e^{8 x}+c_1\right ) \]
Sympy. Time used: 0.879 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
y = Function("y") 
F = Function("F") 
ode = Eq(-F(x) - 12*y(x) + 4*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} - \frac {\int F{\left (x \right )} e^{6 x}\, dx}{8}\right ) e^{- 6 x} + \left (C_{2} + \frac {\int F{\left (x \right )} e^{- 2 x}\, dx}{8}\right ) e^{2 x} \]