35.3.7 problem 7

Internal problem ID [6111]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 3. Linear First-Order Equations. page 403
Problem number : 7
Date solved : Sunday, March 30, 2025 at 10:39:04 AM
CAS classification : [_linear]

\begin{align*} \left (1+{\mathrm e}^{x}\right ) y^{\prime }+2 \,{\mathrm e}^{x} y&=\left (1+{\mathrm e}^{x}\right ) {\mathrm e}^{x} \end{align*}

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