2.3.12 problem 12

Maple step by step solution
Maple trace
Maple dsolve solution
Mathematica DSolve solution

Internal problem ID [8745]
Book : First order enumerated odes
Section : section 3. First order odes solved using Laplace method
Problem number : 12
Date solved : Tuesday, December 17, 2024 at 01:01:57 PM
CAS classification : [_linear]

Solve

\begin{align*} \left (a t +1\right ) y^{\prime }+y&=t \end{align*}

With initial conditions

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

Since initial condition is not at zero, then change of variable is used to transform the ode so that initial condition is at zero.

\begin{align*} \tau = t -1 \end{align*}

Solve

\begin{align*} \left (a \left (\tau +1\right )+1\right ) y^{\prime }+y&=\tau +1 \end{align*}

With initial conditions

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

We will now apply Laplace transform to each term in the ode. Since this is time varying, the following Laplace transform property will be used

\begin{align*} \tau ^{n} f \left (\tau \right ) &\xrightarrow {\mathscr {L}} (-1)^n \frac {d^n}{ds^n} F(s) \end{align*}

Where in the above \(F(s)\) is the laplace transform of \(f \left (\tau \right )\). Applying the above property to each term of the ode gives

\begin{align*} y \left (\tau \right ) &\xrightarrow {\mathscr {L}} Y \left (s \right )\\ \left (a \tau +a +1\right ) \left (\frac {d}{d \tau }y \left (\tau \right )\right ) &\xrightarrow {\mathscr {L}} -a \left (Y \left (s \right )+s \left (\frac {d}{d s}Y \left (s \right )\right )\right )+a \left (s Y \left (s \right )-y \left (0\right )\right )+s Y \left (s \right )-y \left (0\right )\\ \tau +1 &\xrightarrow {\mathscr {L}} \frac {1+s}{s^{2}} \end{align*}

Collecting all the terms above, the ode in Laplace domain becomes

\[ -a \left (Y+s Y^{\prime }\right )+a \left (s Y-y \left (0\right )\right )+s Y-y \left (0\right )+Y = \frac {1+s}{s^{2}} \]

Replacing \(y \left (0\right ) = 0\) in the above results in

\[ -a \left (Y+s Y^{\prime }\right )+a s Y+s Y+Y = \frac {1+s}{s^{2}} \]

The above ode in Y(s) is now solved.

In canonical form a linear first order is

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

Comparing the above to the given ode shows that

\begin{align*} q(s) &=-\frac {\left (s -1\right ) a +1+s}{a s}\\ p(s) &=\frac {-s -1}{s^{3} a} \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,ds}}\\ &= {\mathrm e}^{\int -\frac {\left (s -1\right ) a +1+s}{a s}d s}\\ &= s^{\frac {a -1}{a}} {\mathrm e}^{-\frac {s \left (a +1\right )}{a}} \end{align*}

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}s}}\left ( \mu Y\right ) &= \mu p \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}s}}\left ( \mu Y\right ) &= \left (\mu \right ) \left (\frac {-s -1}{s^{3} a}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}s}} \left (Y \,s^{\frac {a -1}{a}} {\mathrm e}^{-\frac {s \left (a +1\right )}{a}}\right ) &= \left (s^{\frac {a -1}{a}} {\mathrm e}^{-\frac {s \left (a +1\right )}{a}}\right ) \left (\frac {-s -1}{s^{3} a}\right ) \\ \mathrm {d} \left (Y \,s^{\frac {a -1}{a}} {\mathrm e}^{-\frac {s \left (a +1\right )}{a}}\right ) &= \left (\frac {\left (-s -1\right ) s^{\frac {a -1}{a}} {\mathrm e}^{-\frac {s \left (a +1\right )}{a}}}{s^{3} a}\right )\, \mathrm {d} s \\ \end{align*}

Integrating gives

\begin{align*} Y \,s^{\frac {a -1}{a}} {\mathrm e}^{-\frac {s \left (a +1\right )}{a}}&= \int {\frac {\left (-s -1\right ) s^{\frac {a -1}{a}} {\mathrm e}^{-\frac {s \left (a +1\right )}{a}}}{s^{3} a} \,ds} \\ &=\frac {s^{-2+\frac {a -1}{a}} {\mathrm e}^{-\frac {s \left (a +1\right )}{a}}}{a +1} + c_1 \end{align*}

Dividing throughout by the integrating factor \(s^{\frac {a -1}{a}} {\mathrm e}^{-\frac {s \left (a +1\right )}{a}}\) gives the final solution

\[ Y = \frac {1+c_1 \,s^{\frac {a +1}{a}} \left (a +1\right ) {\mathrm e}^{\frac {s \left (a +1\right )}{a}}}{s^{2} \left (a +1\right )} \]

Applying inverse Laplace transform on the above gives.

\begin{align*} y = \frac {\tau }{a +1}+c_1 \mathcal {L}^{-1}\left ({\mathrm e}^{s +\frac {s}{a}} s^{-1+\frac {1}{a}}, s , \tau \right )\tag {1} \end{align*}

Substituting initial conditions \(y \left (0\right ) = 0\) and \(y^{\prime }\left (0\right ) = 0\) into the above solution Gives

\[ 0 = c_1 \mathcal {L}^{-1}\left ({\mathrm e}^{s +\frac {s}{a}} s^{-1+\frac {1}{a}}, s , \tau \right ) \]

Solving for the constant \(c_1\) from the above equation gives

\begin{align*} c_1 = 0 \end{align*}

Substituting the above back into the solution (1) gives

\[ y = \frac {\tau }{a +1} \]

Changing back the solution from \(\tau \) to \(t\) using

\begin{align*} \tau = t -1 \end{align*}

the solution becomes

\begin{align*} y \left (t \right ) = \frac {t -1}{a +1} \end{align*}

Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [\left (a t +1\right ) y^{\prime }+y=t , y \left (1\right )=0\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 }=\frac {-y+t}{a t +1} \\ \bullet & {} & \textrm {Collect w.r.t.}\hspace {3pt} y\hspace {3pt}\textrm {and simplify}\hspace {3pt} \\ {} & {} & y^{\prime }=-\frac {y}{a t +1}+\frac {t}{a t +1} \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} y\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE}\hspace {3pt} \\ {} & {} & y^{\prime }+\frac {y}{a t +1}=\frac {t}{a t +1} \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (t \right ) \\ {} & {} & \mu \left (t \right ) \left (y^{\prime }+\frac {y}{a t +1}\right )=\frac {\mu \left (t \right ) t}{a t +1} \\ \bullet & {} & \textrm {Assume the lhs of the ODE is the total derivative}\hspace {3pt} \frac {d}{d t}\left (y \mu \left (t \right )\right ) \\ {} & {} & \mu \left (t \right ) \left (y^{\prime }+\frac {y}{a t +1}\right )=y^{\prime } \mu \left (t \right )+y \mu ^{\prime }\left (t \right ) \\ \bullet & {} & \textrm {Isolate}\hspace {3pt} \mu ^{\prime }\left (t \right ) \\ {} & {} & \mu ^{\prime }\left (t \right )=\frac {\mu \left (t \right )}{a t +1} \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (t \right )=\left (a t +1\right )^{\frac {1}{a}} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} t \\ {} & {} & \int \left (\frac {d}{d t}\left (y \mu \left (t \right )\right )\right )d t =\int \frac {\mu \left (t \right ) t}{a t +1}d t +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & y \mu \left (t \right )=\int \frac {\mu \left (t \right ) t}{a t +1}d t +\mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {\int \frac {\mu \left (t \right ) t}{a t +1}d t +\mathit {C1}}{\mu \left (t \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (t \right )=\left (a t +1\right )^{\frac {1}{a}} \\ {} & {} & y=\frac {\int \frac {t \left (a t +1\right )^{\frac {1}{a}}}{a t +1}d t +\mathit {C1}}{\left (a t +1\right )^{\frac {1}{a}}} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & y=\frac {\frac {\left (t -1\right ) \left (a t +1\right )^{\frac {1}{a}}}{a +1}+\mathit {C1}}{\left (a t +1\right )^{\frac {1}{a}}} \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & y=\frac {t -1+\left (a t +1\right )^{-\frac {1}{a}} \mathit {C1} \left (a +1\right )}{a +1} \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (1\right )=0 \\ {} & {} & 0=\left (a +1\right )^{-\frac {1}{a}} \mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} \textit {\_C1} \\ {} & {} & \mathit {C1} =0 \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \textit {\_C1} =0\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y=\frac {t -1}{a +1} \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y=\frac {t -1}{a +1} \end {array} \]

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

Solving time : 0.079 (sec)
Leaf size : 13

dsolve([(a*t+1)*diff(y(t),t)+y(t) = t, 
        op([y(1) = 0])], 
        y(t),method=laplace)
 
\[ y = \frac {t -1}{a +1} \]
Mathematica DSolve solution

Solving time : 0.897 (sec)
Leaf size : 14

DSolve[{(1+a*t)*D[y[t],t]+y[t]==t,y[1]==0}, 
       y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \frac {t-1}{a+1} \]