1.69 problem 69

1.69.1 Solved as first order ode of type ID 1
1.69.2 Maple step by step solution
1.69.3 Maple trace
1.69.4 Maple dsolve solution
1.69.5 Mathematica DSolve solution

Internal problem ID [8033]
Book : First order enumerated odes
Section : section 1
Problem number : 69
Date solved : Monday, October 21, 2024 at 04:44:27 PM
CAS classification : [[_1st_order, `_with_symmetry_[F(x),G(x)]`]]

Solve

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

1.69.1 Solved as first order ode of type ID 1

Time used: 0.594 (sec)

Writing the ode as

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

And using the substitution \(u={\mathrm e}^{-y}\) then

\begin{align*} u' &= -y^{\prime } {\mathrm e}^{-y} \end{align*}

The above shows that

\begin{align*} y^{\prime } &= -u^{\prime }\left (x \right ) {\mathrm e}^{y}\\ &= -\frac {u^{\prime }\left (x \right )}{u} \end{align*}

Substituting this in (1) gives

\begin{align*} -\frac {u^{\prime }\left (x \right )}{u}&=\frac {x \,{\mathrm e}^{x}}{u}+\sin \left (x \right ) \end{align*}

The above simplifies to

\begin{align*} -u^{\prime }\left (x \right )&=x \,{\mathrm e}^{x}+\sin \left (x \right ) u \left (x \right )\\ u^{\prime }\left (x \right )+\sin \left (x \right ) u \left (x \right )&=-x \,{\mathrm e}^{x}\tag {2} \end{align*}

Now ode (2) is solved for \(u \left (x \right )\).

In canonical form a linear first order is

\begin{align*} u^{\prime }\left (x \right ) + q(x)u \left (x \right ) &= p(x) \end{align*}

Comparing the above to the given ode shows that

\begin{align*} q(x) &=\sin \left (x \right )\\ p(x) &=-x \,{\mathrm e}^{x} \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int \sin \left (x \right )d x}\\ &= {\mathrm e}^{-\cos \left (x \right )} \end{align*}

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu u\right ) &= \mu p \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu u\right ) &= \left (\mu \right ) \left (-x \,{\mathrm e}^{x}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (u \,{\mathrm e}^{-\cos \left (x \right )}\right ) &= \left ({\mathrm e}^{-\cos \left (x \right )}\right ) \left (-x \,{\mathrm e}^{x}\right ) \\ \mathrm {d} \left (u \,{\mathrm e}^{-\cos \left (x \right )}\right ) &= \left (-x \,{\mathrm e}^{x} {\mathrm e}^{-\cos \left (x \right )}\right )\, \mathrm {d} x \\ \end{align*}

Integrating gives

\begin{align*} u \,{\mathrm e}^{-\cos \left (x \right )}&= \int {-x \,{\mathrm e}^{x} {\mathrm e}^{-\cos \left (x \right )} \,dx} \\ &=\int -x \,{\mathrm e}^{x} {\mathrm e}^{-\cos \left (x \right )}d x + c_1 \end{align*}

Dividing throughout by the integrating factor \({\mathrm e}^{-\cos \left (x \right )}\) gives the final solution

\[ u \left (x \right ) = {\mathrm e}^{\cos \left (x \right )} \left (\int -x \,{\mathrm e}^{x} {\mathrm e}^{-\cos \left (x \right )}d x +c_1 \right ) \]

Substituting the solution found for \(u \left (x \right )\) in \(u={\mathrm e}^{-y}\) gives

\begin{align*} y&= -\ln \left (u \left (x \right )\right )\\ &= -\ln \left (-\ln \left (\left (-\left (\int x \,{\mathrm e}^{x -\cos \left (x \right )}d x \right )+c_1 \right ) {\mathrm e}^{\cos \left (x \right )}\right )\right )\\ &= -\ln \left (\left (-\left (\int x \,{\mathrm e}^{x -\cos \left (x \right )}d x \right )+c_1 \right ) {\mathrm e}^{\cos \left (x \right )}\right ) \end{align*}
Figure 93: Slope field plot
\(y^{\prime } = x \,{\mathrm e}^{x +y}+\sin \left (x \right )\)
1.69.2 Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & y^{\prime }=x \,{\mathrm e}^{x +y}+\sin \left (x \right ) \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & y^{\prime }=x \,{\mathrm e}^{x +y}+\sin \left (x \right ) \end {array} \]

1.69.3 Maple trace
Methods for first order ODEs:
 
1.69.4 Maple dsolve solution

Solving time : 0.011 (sec)
Leaf size : 29

dsolve(diff(y(x),x) = x*exp(x+y(x))+sin(x), 
       y(x),singsol=all)
 
\[ y = -\cos \left (x \right )-\ln \left (-c_1 -\left (\int x \,{\mathrm e}^{x -\cos \left (x \right )}d x \right )\right ) \]
1.69.5 Mathematica DSolve solution

Solving time : 3.151 (sec)
Leaf size : 100

DSolve[{D[y[x],x]==x*Exp[x+y[x]]+Sin[x],{}}, 
       y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\int _1^x\left (-e^{K[1]-\cos (K[1])} K[1]-e^{-\cos (K[1])-y(x)} \sin (K[1])\right )dK[1]+\int _1^{y(x)}-e^{-\cos (x)-K[2]} \left (e^{\cos (x)+K[2]} \int _1^xe^{-\cos (K[1])-K[2]} \sin (K[1])dK[1]-1\right )dK[2]=c_1,y(x)\right ] \]