32.6.1 problem Exercise 12.1, page 103

Internal problem ID [5866]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 2. Special types of differential equations of the first kind. Lesson 12, Miscellaneous Methods
Problem number : Exercise 12.1, page 103
Date solved : Sunday, March 30, 2025 at 10:20:35 AM
CAS classification : [_Bernoulli]

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

Maple. Time used: 0.007 (sec). Leaf size: 59
ode:=2*x*y(x)*diff(y(x),x)+(1+x)*y(x)^2 = exp(x); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= -\frac {\sqrt {2}\, \sqrt {{\mathrm e}^{x} x \left ({\mathrm e}^{2 x}+2 c_1 \right )}\, {\mathrm e}^{-x}}{2 x} \\ y &= \frac {\sqrt {2}\, \sqrt {{\mathrm e}^{x} x \left ({\mathrm e}^{2 x}+2 c_1 \right )}\, {\mathrm e}^{-x}}{2 x} \\ \end{align*}
Mathematica. Time used: 4.128 (sec). Leaf size: 70
ode=2*x*y[x]*D[y[x],x]+(1+x)*y[x]^2==Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {\sqrt {e^x+2 c_1 e^{-x-1}}}{\sqrt {2} \sqrt {x}} \\ y(x)\to \frac {\sqrt {e^x+2 c_1 e^{-x-1}}}{\sqrt {2} \sqrt {x}} \\ \end{align*}
Sympy. Time used: 0.667 (sec). Leaf size: 46
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*y(x)*Derivative(y(x), x) + (x + 1)*y(x)**2 - exp(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \frac {\sqrt {2} \sqrt {\frac {C_{1} e^{- x} + e^{x}}{x}}}{2}, \ y{\left (x \right )} = \frac {\sqrt {2} \sqrt {\frac {C_{1} e^{- x} + e^{x}}{x}}}{2}\right ] \]