15.11.9 problem 9

Internal problem ID [3119]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 19, page 86
Problem number : 9
Date solved : Sunday, March 30, 2025 at 01:18:52 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.004 (sec). Leaf size: 28
ode:=diff(diff(y(x),x),x)-4*y(x) = x+exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (4 x +16 c_1 -1\right ) {\mathrm e}^{2 x}}{16}+{\mathrm e}^{-2 x} c_2 -\frac {x}{4} \]
Mathematica. Time used: 0.184 (sec). Leaf size: 36
ode=D[y[x],{x,2}]-4*y[x]==x+Exp[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {x}{4}+e^{2 x} \left (\frac {x}{4}-\frac {1}{16}+c_1\right )+c_2 e^{-2 x} \]
Sympy. Time used: 0.114 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x - 4*y(x) - exp(2*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{2} e^{- 2 x} - \frac {x}{4} + \left (C_{1} + \frac {x}{4}\right ) e^{2 x} \]