1.4 problem Example 6

1.4.1 Existence and uniqueness analysis
1.4.2 Solved as first order linear ode
1.4.3 Maple step by step solution
1.4.4 Maple trace
1.4.5 Maple dsolve solution
1.4.6 Mathematica DSolve solution

Internal problem ID [2297]
Book : Differential equations and their applications, 3rd ed., M. Braun
Section : Section 1.2. Page 6
Problem number : Example 6
Date solved : Thursday, October 17, 2024 at 02:22:55 AM
CAS classification : [_separable]

Solve

\begin{align*} y^{\prime }+2 t y&=t \end{align*}

With initial conditions

\begin{align*} y \left (1\right )&=2 \end{align*}

1.4.1 Existence and uniqueness analysis

This is a linear ODE. In canonical form it is written as

\begin{align*} y^{\prime } + q(t)y &= p(t) \end{align*}

Where here

\begin{align*} q(t) &=2 t\\ p(t) &=t \end{align*}

Hence the ode is

\begin{align*} y^{\prime }+2 t y = t \end{align*}

The domain of \(q(t)=2 t\) is

\[ \{-\infty <t <\infty \} \]

And the point \(t_0 = 1\) is inside this domain. The domain of \(p(t)=t\) is

\[ \{-\infty <t <\infty \} \]

And the point \(t_0 = 1\) is also inside this domain. Hence solution exists and is unique.

1.4.2 Solved as first order linear ode

Time used: 0.140 (sec)

In canonical form a linear first order is

\begin{align*} y^{\prime } + q(t)y &= p(t) \end{align*}

Comparing the above to the given ode shows that

\begin{align*} q(t) &=2 t\\ p(t) &=t \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,dt}}\\ &= {\mathrm e}^{\int 2 t d t}\\ &= {\mathrm e}^{t^{2}} \end{align*}

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}t}}\left ( \mu y\right ) &= \mu p \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}t}}\left ( \mu y\right ) &= \left (\mu \right ) \left (t\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}t}} \left (y \,{\mathrm e}^{t^{2}}\right ) &= \left ({\mathrm e}^{t^{2}}\right ) \left (t\right ) \\ \mathrm {d} \left (y \,{\mathrm e}^{t^{2}}\right ) &= \left (t \,{\mathrm e}^{t^{2}}\right )\, \mathrm {d} t \\ \end{align*}

Integrating gives

\begin{align*} y \,{\mathrm e}^{t^{2}}&= \int {t \,{\mathrm e}^{t^{2}} \,dt} \\ &=\frac {{\mathrm e}^{t^{2}}}{2} + c_1 \end{align*}

Dividing throughout by the integrating factor \({\mathrm e}^{t^{2}}\) gives the final solution

\[ y = \frac {1}{2}+c_1 \,{\mathrm e}^{-t^{2}} \]

Solving for the constant of integration from initial conditions, the solution becomes

\begin{align*} y = \frac {1}{2}+\frac {3 \,{\mathrm e} \,{\mathrm e}^{-t^{2}}}{2} \end{align*}

(a) Solution plot
\(y = \frac {1}{2}+\frac {3 \,{\mathrm e} \,{\mathrm e}^{-t^{2}}}{2}\)

(b) Slope field plot
\(y^{\prime }+2 t y = t\)
1.4.3 Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [\frac {d}{d t}y \left (t \right )+2 t y \left (t \right )=t , y \left (1\right )=2\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d t}y \left (t \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d t}y \left (t \right )=-2 t y \left (t \right )+t \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \frac {\frac {d}{d t}y \left (t \right )}{2 y \left (t \right )-1}=-t \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} t \\ {} & {} & \int \frac {\frac {d}{d t}y \left (t \right )}{2 y \left (t \right )-1}d t =\int -t d t +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \frac {\ln \left (2 y \left (t \right )-1\right )}{2}=-\frac {t^{2}}{2}+\mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \left (t \right ) \\ {} & {} & y \left (t \right )=\frac {{\mathrm e}^{-t^{2}+2 \mathit {C1}}}{2}+\frac {1}{2} \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (1\right )=2 \\ {} & {} & 2=\frac {{\mathrm e}^{2 \mathit {C1} -1}}{2}+\frac {1}{2} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} \textit {\_C1} \\ {} & {} & \mathit {C1} =\frac {1}{2}+\frac {\ln \left (3\right )}{2} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \textit {\_C1} =\frac {1}{2}+\frac {\ln \left (3\right )}{2}\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y \left (t \right )=\frac {3 \,{\mathrm e}^{-\left (t -1\right ) \left (t +1\right )}}{2}+\frac {1}{2} \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y \left (t \right )=\frac {3 \,{\mathrm e}^{-\left (t -1\right ) \left (t +1\right )}}{2}+\frac {1}{2} \end {array} \]

1.4.4 Maple trace
`Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
<- 1st order linear successful`
 
1.4.5 Maple dsolve solution

Solving time : 0.012 (sec)
Leaf size : 17

dsolve([diff(y(t),t)+2*t*y(t) = t, 
       op([y(1) = 2])],y(t),singsol=all)
 
\[ y = \frac {1}{2}+\frac {3 \,{\mathrm e}^{-\left (t -1\right ) \left (t +1\right )}}{2} \]
1.4.6 Mathematica DSolve solution

Solving time : 0.037 (sec)
Leaf size : 22

DSolve[{D[y[t],t]+2*t*y[t]==t,y[1]==2}, 
       y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {3 e^{1-t^2}}{2}+\frac {1}{2} \]