76.4.20 problem 26

Internal problem ID [17343]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 2. First order differential equations. Section 2.6 (Exact equations and integrating factors). Problems at page 100
Problem number : 26
Date solved : Monday, March 31, 2025 at 03:55:24 PM
CAS classification : [[_linear, `class A`]]

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

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