39.2.7 problem Problem 11.50

Internal problem ID [6524]
Book : Schaums Outline Differential Equations, 4th edition. Bronson and Costa. McGraw Hill 2014
Section : Chapter 11. THE METHOD OF UNDETERMINED COEFFICIENTS. Supplementary Problems. page 101
Problem number : Problem 11.50
Date solved : Sunday, March 30, 2025 at 11:06:25 AM
CAS classification : [[_linear, `class A`]]

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

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