20.7.1 problem Problem 25

Internal problem ID [3716]
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.3, The Method of Undetermined Coefficients. page 525
Problem number : Problem 25
Date solved : Tuesday, March 04, 2025 at 05:08:12 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+y&=6 \,{\mathrm e}^{x} \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 17
ode:=diff(diff(y(x),x),x)+y(x) = 6*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = c_{2} \sin \left (x \right )+\cos \left (x \right ) c_{1} +3 \,{\mathrm e}^{x} \]
Mathematica. Time used: 0.014 (sec). Leaf size: 21
ode=D[y[x],{x,2}]+y[x]==6*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to 3 e^x+c_1 \cos (x)+c_2 \sin (x) \]
Sympy. Time used: 0.057 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) - 6*exp(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (x \right )} + C_{2} \cos {\left (x \right )} + 3 e^{x} \]