3.1 Quizz 1

  3.1.1 Problem 1
  3.1.2 Problem 2
  3.1.3 Problem 3
  3.1.4 Problem 4

PDF (letter size)

PDF (legal size)

3.1.1 Problem 1

Find the general solution of the following differential equation\[ \frac {dy}{dx}=y+2xe^{2x}\] Solution

Writing the ODE as\begin {equation} \frac {dy}{dx}-y=2xe^{2x} \tag {1} \end {equation} Shows it is a linear ode as it has for form   \(y^{\prime }+p\relax (x) y=q\relax (x) \) where in this case \(p\relax (x) =-1\) and \(q\relax (x) =2xe^{2x}\). The first step is to determine the integrating factor, which is given by \begin {align*} I & =e^{\int p\relax (x) dx}\\ & =e^{\int -1dx}\\ & =e^{-x} \end {align*}

Multiplying both sides of (1) by this integrating factor gives\begin {align*} e^{-x}\left (\frac {dy}{dx}-y\right ) & =2xe^{2x}e^{-x}\\ \left (\frac {dy}{dx}e^{-x}-ye^{-x}\right ) & =2xe^{x} \end {align*}

But \(\left (\frac {dy}{dx}e^{-x}-ye^{-x}\right ) =\frac {d}{dx}\left ( ye^{-x}\right ) \) by the product rule. Hence the above becomes\begin {align*} \frac {d}{dx}\left (ye^{-x}\right ) & =2xe^{x}\\ d\left (ye^{-x}\right ) & =2xe^{x}dx \end {align*}

Integrating both sides gives\begin {align} \int d\left (ye^{-x}\right ) & =\int 2xe^{x}dx\nonumber \\ ye^{-x} & =2\int xe^{x}dx+C \tag {2} \end {align}

Where \(C\) is the constant of integration. What is left is to solve the integral \(\int xe^{x}dx\). Using integration by parts\[ \int udv=uv-\int vdu \] Let \(u=x,dv=e^{x}dx\), therefore \(du=dx\) and \(v=e^{x}\). Therefore\begin {align*} \int xe^{x}dx & =uv-\int vdu\\ & =xe^{x}-\int e^{x}dx \end {align*}

But \(\int e^{x}dx=e^{x}\). Hence the above becomes\begin {equation} \int xe^{x}dx=xe^{x}-e^{x} \tag {3} \end {equation} Note that a constant of integration is not needed in (3), since constant of integration was already added in (2) earlier. Substituting (3) in (2) gives\[ ye^{-x}=2\left (xe^{x}-e^{x}\right ) +C \] Solving for \(y\) from the above (by multiplying both sides of the above equation by \(e^{x}\)), gives the general solution\begin {align*} y & =2\left (xe^{x}-e^{x}\right ) e^{x}+Ce^{x}\\ & =2\left (xe^{2x}-e^{2x}\right ) +Ce^{x} \end {align*}

Therefore\[ y\relax (x) =2e^{2x}\left (x-1\right ) +Ce^{x}\] The solution contains one constant of integration as expected since the order of the ODE is one.

3.1.2 Problem 2

Solve \[ \frac {dy}{dx}=2xy\left (4-y\right ) \] Solution

This ode is separable because it can be written as \[ y^{\prime }=p\relax (y) q\relax (x) \] Where the function \(p\relax (y) \) depends explicitly on \(y\) only and the function \(q\relax (x) \) depends on \(x\) only. In the given ODE, \(p\relax (y) =y\left (4-y\right ) \) and \(q\relax (x) =2x\). Hence the ODE can be be written as\begin {align*} \frac {dy}{dx} & =p\relax (y) q\relax (x) \\ \frac {1}{p\relax (y) }dy & =q\relax (x) dx\qquad y\neq 4 \end {align*}

Integrating both  sides gives\[ \int \frac {1}{p\relax (y) }dy=\int q\relax (x) dx \] Replacing \(p\relax (y) =y\left (4-y\right ) \) and \(q\relax (x) =2x\) into the above gives\begin {equation} \int \frac {1}{y\left (4-y\right ) }dy=\int 2xdx \tag {1} \end {equation} The integral on the right side is \begin {align} \int 2xdx & =\frac {2x^{2}}{2}+C_{1}\nonumber \\ & =x^{2}+C_{1} \tag {2} \end {align}

Where \(C_{1}\) is the constant of integration. The integral on the left side is solved using partial fractions. Let\begin {align*} \frac {1}{y\left (4-y\right ) } & =\frac {A}{y}+\frac {B}{4-y}\\ & =\frac {A\left (4-y\right ) +By}{y\left (4-y\right ) }\\ & =\frac {4A-yA+By}{y\left (4-y\right ) }\\ & =\frac {4A-y\left (A-B\right ) }{y\left (4-y\right ) } \end {align*}

Comparing the numerators shows that\[ 1=4A-y\left (A-B\right ) \] Which implies, by comparing coefficients of \(y\) on each side that \(4A=1\) and \(\left (A-B\right ) =0\). This means \(A=\frac {1}{4}\) and \(B=\frac {1}{4}\). Therefore\begin {align*} \frac {1}{y\left (4-y\right ) } & =\frac {1}{4}\frac {1}{y}+\frac {1}{4}\frac {1}{4-y}\\ & =\frac {1}{4}\frac {1}{y}-\frac {1}{4}\frac {1}{y-4} \end {align*}

Hence the left integral in (1) now can be written as\begin {equation} \int \frac {1}{y\left (4-y\right ) }dy=\frac {1}{4}\int \frac {1}{y}dy-\frac {1}{4}\int \frac {1}{y-4}dy \tag {3} \end {equation} But \(\int \frac {1}{y}dy=\ln \left \vert y\right \vert \). To find \(\int \frac {1}{y-4}dy\), let \(y-4=u\). Hence \(dy=du\). Therefore \begin {align*} \int \frac {1}{y-4}dy & =\int \frac {1}{u}du\\ & =\ln \left \vert u\right \vert \\ & =\ln \left (\left \vert y-4\right \vert \right ) \end {align*}

Substituting all of this back in (3) gives\begin {align} \int \frac {1}{y\left (4-y\right ) }dy & =\frac {1}{4}\ln \left \vert y\right \vert -\frac {1}{4}\ln \left (\left \vert y-4\right \vert \right ) \nonumber \\ & =\frac {1}{4}\left (\ln \left \vert y\right \vert -\ln \left (\left \vert 4-y\right \vert \right ) \right ) \nonumber \\ & =\frac {1}{4}\ln \left \vert \frac {y}{4-y}\right \vert \tag {4} \end {align}

Now that both integrals are found, substituting (4) and (2) back in (1) gives\begin {align*} \frac {1}{4}\ln \left \vert \frac {y}{4-y}\right \vert & =x^{2}+C_{1}\\ \ln \left \vert \frac {y}{4-y}\right \vert & =4x^{2}+4C_{1} \end {align*}

Let \(4C_{1}=C_{2}\), a new constant.\[ \ln \left \vert \frac {y}{4-y}\right \vert =4x^{2}+C_{2}\] Raising both sides to exponential gives\begin {align*} \left \vert \frac {y}{4-y}\right \vert & =e^{4x^{2}+C_{2}}\\ & =e^{C_{2}}e^{4x^{2}} \end {align*}

Let \(e^{C_{2}}=C\) a new constant. The above becomes\[ \frac {y}{4-y}=Ce^{4x^{2}}\] The absolute on the left side can be removed by letting the new constant \(C\) absorbs the sign for either positive or negative..

Solving for \(y\) from the above in order to obtain an explicit solution gives\begin {align*} y & =\left (4-y\right ) Ce^{4x^{2}}\\ & =4Ce^{4x^{2}}-yCe^{4x^{2}}\\ y+yCe^{4x^{2}} & =4Ce^{4x^{2}}\\ y\left (1+Ce^{4x^{2}}\right ) & =4Ce^{4x^{2}} \end {align*}

Hence the solution is \[ y=\frac {4Ce^{4x^{2}}}{1+Ce^{4x^{2}}}\] The above can be simplified further by dividing numerator and denominator by \(Ce^{4x^{2}}\neq 0\) which gives\[ y=\frac {4}{\frac {1}{C}e^{-4x^{2}}+1}\] Let \(\frac {1}{C}=C_{0}\) a new constant. Hence the final general solution becomes\[ y\relax (x) =\frac {4}{1+C_{0}e^{-4x^{2}}}\] Where \(C_{0}\) is the constant of integration which can be found from initial conditions when given.

3.1.3 Problem 3

Solve \[ \frac {dy}{dx}=\frac {x^{2}+3y^{2}}{2xy}\] Solution

This is homogeneous ODE. Dividing both the numerator and denominator of the right side by \(xy\neq \) gives\begin {align} \frac {dy}{dx} & =\frac {\frac {x^{2}}{xy}+3\frac {y^{2}}{xy}}{2\frac {xy}{xy}}\nonumber \\ & =\frac {\frac {x}{y}+3\frac {y}{x}}{2} \tag {1} \end {align}

Let \(v\relax (x) =\frac {y\relax (x) }{x}\) be a new dependent variable. Hence \(y=vx\). By the product rule\[ \frac {dy}{dx}=v+\frac {dv}{dx}x \] Substituting \(v=\frac {y}{x}\) and replacing \(\frac {dy}{dx}\) by the above into (1) gives a new ODE in \(v\relax (x) \) which is now separable\begin {align*} v+\frac {dv}{dx}x & =\frac {\frac {1}{v}+3v}{2}\\ \frac {dv}{dx}x & =\frac {\frac {1}{v}+3v}{2}-v\\ & =\frac {\frac {1+3v^{2}}{v}}{2}-v\\ & =\frac {1+3v^{2}}{2v}-v\\ & =\frac {1+3v^{2}-2v^{2}}{2v}\\ & =\frac {1+v^{2}}{2v} \end {align*}

The above ODE is separable. It can be written as\begin {align*} \frac {2v}{1+v^{2}}\frac {dv}{dx} & =\frac {1}{x}\qquad x\neq 0\\ \frac {2v}{1+v^{2}}dv & =\frac {dx}{x} \end {align*}

Integrating gives\begin {align} \int \frac {2v}{1+v^{2}}dv & =\int \frac {dx}{x}\nonumber \\ & =\ln \left \vert x\right \vert +C_{1} \tag {2} \end {align}

Where \(C_{1}\) is constant of integration. To evaluate the left integral \(\int \frac {2v}{1+v^{2}}dv\), let \(u=1+v^{2}\). Hence \(du=2vdv\). Therefore\begin {align*} \int \frac {2v}{1+v^{2}}dv & =\int \frac {2v}{u}\left (\frac {du}{2v}\right ) \\ & =\int \frac {du}{u}\\ & =\ln \left \vert u\right \vert \\ & =\ln \left \vert 1+v^{2}\right \vert \end {align*}

But \(\left \vert 1+v^{2}\right \vert \) is always positive so the absolute sign is not needed. Therefore\[ \int \frac {2v}{1+v^{2}}dv=\ln \left (1+v^{2}\right ) \] Substituting the above in (2) gives\[ \ln \left (1+v^{2}\right ) =\ln \left \vert x\right \vert +C_{1}\] Raising both sides to exponential gives\begin {align*} 1+v^{2} & =e^{\ln \left \vert x\right \vert +C_{1}}\\ & =xe^{C_{1}} \end {align*}

Since exponential function is never negative. Let \(e^{C_{1}}=C\) be a new constant. The above becomes\begin {align*} 1+v^{2} & =Cx\\ v^{2} & =Cx-1\\ v & =\pm \sqrt {Cx-1} \end {align*}

But \(v=\frac {y}{x}\). Hence the above becomes\[ \frac {y}{x}=\pm \sqrt {Cx-1}\] Which implies\[ y=\pm x\sqrt {Cx-1}\qquad x\neq 0 \] There are two solutions. They are\begin {align*} y_{1}\relax (x) & =x\sqrt {Cx-1}\\ y_{2}\relax (x) & =-x\sqrt {Cx-1} \end {align*}

3.1.4 Problem 4

A tank initially contains \(120\) L of pure water. A mixture containing of \(\alpha \) g/L of salt enters the tank at a rate of \(2\) L/min, and the well-stirred mixture leaves the tank at the same rate. Find an expression in terms of \(\alpha \) for the amount of salt in the tank at any time \(t\). Also find the limiting amount of salt in the tank as \(t\rightarrow \infty \)

Solution

pict
Figure 3.1:Showing tank flow and initial conditions

Let \(x\relax (t) \) be mass (amount) of salt (in grams) in the tank at time \(t\). Let \(V\relax (t) \) be the volume of water (mixture) (in litre) in the tank at time \(t\). Using the equilibrium equation for change of mass of salt\[ \frac {dx}{dt}=\text {rate of salt mass in }-\text { rate of salt mass out}\] Which becomes\begin {align} \frac {dx}{dt} & =\left (2\text { }\frac {\text {L}}{\text {min}}\right ) \left ( \alpha \ \frac {\text {g}}{\text {L}}\right ) \text { }-\text { }\left (2\text { }\frac {\text {L}}{\text {min}}\right ) \left (\frac {x\relax (t) }{V\relax (t) }\ \frac {\text {g}}{\text {L}}\right ) \nonumber \\ & =2\alpha -2\frac {x\relax (t) }{V\relax (t) }\tag {1} \end {align}

But \begin {align*} V\relax (t) & =V\relax (0) +\left (\text {rate of mixture volume in }-\text { rate of mixture volume out}\right ) t\\ & =V\relax (0) +\left (2-2\right ) t\\ & =V\relax (0) \end {align*}

But we are given that \(V\relax (0) =120\) L. Hence\[ V\relax (t) =120 \] Which means the volume of mixture remains constant in the tank (this is as expected, since rate of flow in is the same as rate of flow out). Substituting the above in (1) gives the ODE to solve\begin {align*} \frac {dx}{dt} & =2\alpha -2\frac {x}{120}\\ & =2\alpha -\frac {x}{60} \end {align*}

The solution to above ODE gives the mass \(x\relax (t) \) of salt in tank at time \(t\). \begin {equation} \frac {dx}{dt}+\frac {x}{60}=2\alpha \tag {2} \end {equation} This is linear ODE as it has the form \(x^{\prime }+p\relax (t) x=q\relax (t) \). The integrating factor is \(I=e^{\int p\left ( t\right ) dt}=e^{\int \frac {1}{60}dt}=e^{\frac {t}{60}}\). Multiplying both sides of the above ODE (2) by this integrating factor gives\begin {align*} e^{\frac {t}{60}}\left (\frac {dx}{dt}+\frac {x}{60}\right ) & =2\alpha e^{\frac {t}{60}}\\ \left (\frac {dx}{dt}e^{\frac {t}{60}}+\frac {x}{60}e^{\frac {t}{60}}\right ) & =2\alpha e^{\frac {t}{60}} \end {align*}

But \(\left (\frac {dx}{dt}e^{\frac {t}{60}}+\frac {x}{60}e^{\frac {t}{60}}\right ) =\frac {d}{dt}\left (xe^{\frac {t}{60}}\right ) \) by the product rule. Hence the above becomes\[ \frac {d}{dt}\left (xe^{\frac {t}{60}}\right ) =2\alpha e^{\frac {t}{60}}\] Integrating both sides gives\begin {align*} \int d\left (xe^{\frac {t}{60}}\right ) & =\int 2\alpha e^{\frac {t}{60}}dt\\ xe^{\frac {t}{60}} & =2\alpha \int e^{\frac {t}{60}}dt+C \end {align*}

Where \(C\) is the constant of integration. To evaluate\(\ \int e^{\frac {t}{60}}dt\), let \(\frac {t}{60}=u\), then \(\frac {1}{60}dt=du\). Hence \(\int e^{\frac {t}{60}}dt=\int e^{u}\left (60du\right ) =60\int e^{u}du=60e^{u}\) or \(60e^{\frac {t}{60}}\). Therefore the above becomes \begin {align*} xe^{\frac {t}{60}} & =2\alpha \left (60e^{\frac {t}{60}}\right ) +C\\ & =120\alpha e^{\frac {t}{60}}+C \end {align*}

Multiplying both sides by \(e^{-\frac {t}{60}}\) gives the general solution as\begin {equation} x\relax (t) =120\alpha +Ce^{\frac {-t}{60}}\tag {3} \end {equation} Initial conditions are now used to find \(C\). At \(t=0\), we are given that \(x\relax (0) =0\)  since there was no salt in the tank initially. Hence the above becomes at \(t=0\)\begin {align*} 0 & =120\alpha +C\\ C & =-120\alpha \end {align*}

Therefore (3) becomes the particular solution given by\begin {equation} x\relax (t) =120\alpha -120\alpha e^{\frac {-t}{60}}\tag {4} \end {equation} To answer the final part, as \(t\rightarrow \infty \) then \(e^{\frac {-t}{60}}\rightarrow e^{-\infty }\rightarrow 0\) and the above gives\[ \lim _{t\rightarrow \infty }x\relax (t) =120\alpha \] In grams. The above is the limiting mass (amount) of salt in the tank. For example if \(\alpha =1\) grams per liter, then the maximum possible mass of salt in the tank will be \(120\) grams. The amount of salt is initially zero in the tank, and increases exponentially before leveling off at the limit given by \(120\alpha \) grams. The following is a plot that illustrates this for \(\alpha =1\).


pict
Figure 3.2:Showing limiting value of amount of salt for \(\alpha =1\)