2.1 HW 1

  2.1.1 Problems listing
  2.1.2 Problem 1
  2.1.3 Problem 2
  2.1.4 Problem 3
  2.1.5 Problem 4
  2.1.6 Problem 5
  2.1.7 Problem 6
  2.1.8 Problem 7
  2.1.9 Problem 8
  2.1.10 Problem 9
  2.1.11 Problem 10
  2.1.12 Problem 11
  2.1.13 Problem 12
  2.1.14 Problem 13
  2.1.15 Problem 14
  2.1.16 Marks per problem

2.1.1 Problems listing

PDF

PDF (letter size)

PDF (legal size)

2.1.2 Problem 1

Determine the order of the differential equation a) \(\left (\frac {dy}{dx}\right ) ^{3}+y^{2}=\sin x\), b) \(t^{2}\frac {d^{2}y}{dt^{2}}+t\frac {dy}{dt}+2y=\sin \relax (t) \)

Solution

For (a), the order is one. Since highest derivative \(\frac {dy}{dx}\) is of order one. For (b) the order is second. Since highest derivative \(\frac {d^{2}y}{dt^{2}}\) is of order two.

2.1.3 Problem 2

Verify for \(t>0,y\relax (t) =\ln t\) is a solution to \(2\left ( \frac {dy}{dt}\right ) ^{3}=\frac {d^{3}y}{dt^{3}}\)

Solution

The verification is done by substituting the solution into the ODE, if the result is an identity (both sides of the equation are the same), then it is verified, otherwise it is not.  Since solution is \(y\relax (t) =\ln t\) then \(\frac {dy}{dt}=\frac {1}{t}\) and \(\frac {d^{2}y}{dt^{2}}=\frac {-1}{t^{2}}\) and \(\frac {d^{3}y}{dt^{3}}=\frac {2}{t^{3}}\). Substituting these into the ODE gives\begin {align*} 2\left (\frac {1}{t}\right ) ^{3} & =\frac {2}{t^{3}}\\ \frac {2}{t^{3}} & =\frac {2}{t^{3}} \end {align*}

Which is an identity. Hence \(y\relax (t) =\ln t\) is a solution to the ODE.

2.1.4 Problem 3

Determine whether the differential equation is linear or nonlinear a) \(y^{\prime \prime \prime }+4y^{\prime \prime }+\sin xy^{\prime }=xy^{2}+\tan x\), b) \(t^{2}y^{\prime \prime }+ty^{\prime }+2y=\sin t\)

Solution

ODE (a) is not linear, due to presence of the term \(y^{2}\) while ODE (b) is linear, since all derivative terms of the dependent variable and the dependent variable are linear.

2.1.5 Problem 4

Prove (show) that the initial-value problem \(y^{\prime }=x\sin \left ( x+y\right ) \), \(y\relax (0) =1\) has a unique solution using the existence and uniqueness theorem

Solution

Writing the ODE as\begin {align*} y^{\prime } & =x\sin \left (x+y\right ) \\ & =f\left (x,y\right ) \end {align*}

Shows that \(f\left (x,y\right ) \) is continuous everywhere, since \(x\) and \(\sin \) function are continuous everywhere. And\[ \frac {\partial f}{\partial y}=x\cos \left (x+y\right ) \] Which is also continuous everywhere. This shows there exists an interval \(I\) which must contain \(x_{0}=0\) where the initial value ODE given above has a solution and the solution is unique for all \(x\) in \(I\).

2.1.6 Problem 5

   2.1.6.1 Part a
   2.1.6.2 Part b

Let \(y^{\prime }=\left (y-2\right ) \left (y+1\right ) \). a) Determine all equilibrium solutions. b) Determine the region in the xy-plane where the solutions are increasing, and where the solutions are decreasing.

Solution

2.1.6.1 Part a

The equilibrium solutions are given by solution to \(y^{\prime }=0\) which gives \(y=2,y=-1\).

2.1.6.2 Part b

The equilibrium solutions divide the solution domain into three regions. One is \(y>2\) and one is where \(-1<y<2\) and one where \(y<-1\).

When \(y>2\), we see that \(\left (y-2\right ) \left (y+1\right ) \) is always positive. Hence \(y^{\prime }\) is positive, which means the solution is increasing.

When \(y<-1\), then \(\left (y-2\right ) <0\) and also \(\left (y+1\right ) <0\). Hence the product is positive, This means for \(y<-1\), the slope is positive and the solution is increasing.  

For \(-1<y<2\), the term \(\left (y-2\right ) \) is negative and the term \(\left (y+1\right ) \) is positive. Hence the product is negative. This means the slope is negative and the solution is decreasing. Therefore

\[ \left \{ \begin {array} [c]{ccc}y>2 & & \text {increasing}\\ -1<y<2 & & \text {decreasing}\\ y<-1 & & \text {increasing}\end {array} \right . \]

To verify this, the following is a plot of the solution curves. It shows the 3 regions which agrees with the above result.


pict
Figure 2.1:Solution curves

2.1.7 Problem 6

   2.1.7.1 Part a
   2.1.7.2 Part b

Solve the following differential equations a) \(\frac {dy}{dx}=\frac {y}{x\ln x}\). b) \(\left (x^{2}+1\right ) y^{\prime }+y^{2}=-1,y\relax (0) =1\)

Solution

2.1.7.1 Part a

This is separable ODE, it can be written as\[ \frac {dy}{y}=\frac {dx}{x\ln x}\] Integrating gives\[ \ln \left \vert y\right \vert =\int \frac {dx}{x\ln x}+C_{1}\] To find \(\int \frac {dx}{x\ln x}\), we notice that, by definition \(\frac {d}{dx}\ln \left (\ln x\right ) =\frac {\frac {d}{dx}\ln x}{\ln x}=\frac {1}{x\ln x}\). This shows that \(\ln \left (\ln x\right ) \) is the antiderivative. Hence the above becomes\[ \ln \left \vert y\right \vert =\ln \left (\ln \left \vert x\right \vert \right ) +C_{1}\] Taking the exponential of both sides gives\[ y=Ce^{\ln \left (\ln \left \vert x\right \vert \right ) }\] Where the sign is absorbed by the constant \(C\). Hence\[ y=C\ln x \]

2.1.7.2 Part b

The ODE is\begin {align*} y^{\prime } & =\frac {-1}{\left (x^{2}+1\right ) }-\frac {y^{2}}{\left ( x^{2}+1\right ) }\\ & =\frac {\left (-1-y^{2}\right ) }{\left (x^{2}+1\right ) }\\ & =\frac {-1}{\left (x^{2}+1\right ) }\left (1+y^{2}\right ) \end {align*}

This is now separable. \[ \frac {dy}{\left (1+y^{2}\right ) }=\frac {-dx}{\left (x^{2}+1\right ) }\] Integrating gives\[ \arctan \relax (y) =-\arctan \relax (x) +C \] or\begin {equation} y=-\tan \left (\arctan \relax (x) +C\right ) \tag {1} \end {equation} Applying initial conditions \(y\relax (0) =1\) to the above gives\begin {align*} 1 & =-\tan \left (\arctan \relax (0) +C\right ) \\ & =-\tan \relax (C) \end {align*}

Hence \(C=-\frac {\pi }{4}\). Therefore the general solution (1) becomes\begin {align*} y & =-\tan \left (\arctan \relax (x) -\frac {\pi }{4}\right ) \\ & =\tan \left (\frac {\pi }{4}-\arctan \relax (x) \right ) \end {align*}

2.1.8 Problem 7

   2.1.8.1 Part a
   2.1.8.2 Part b

Solve the following differential equations a) \(\frac {dy}{dx}+\frac {2}{x}y=5x^{2},x>0\), b) \(t\frac {dx}{dt}+2x=4e^{t},t>0\)

Solution

2.1.8.1 Part a

This is a linear ODE in \(y\). It is of the form \(y^{\prime }+p\relax (x) y=q\relax (x) \), where \(p\relax (x) =\frac {2}{x},q\left ( x\right ) =5x^{2}\). Hence the integrating factor is \(I=e^{\int p\left ( x\right ) dx}=e^{\int \frac {2}{x}dx}=e^{2\ln x}\) or \(I=x^{2}\). Multiplying both sides by this integrating factor make the LHS complete differential giving

\begin {align*} \frac {d}{dx}\left (Iy\right ) & =I\left (5x^{2}\right ) \\ \frac {d}{dx}\left (yx^{2}\right ) & =5x^{4}\\ yx^{2} & =\int 5x^{4}dx\\ yx^{2} & =5\frac {x^{5}}{5}+C\\ yx^{2} & =x^{5}+C\\ y & =x^{3}+\frac {C}{x^{2}}\qquad x\neq 0 \end {align*}

The above is the general solution.

2.1.8.2 Part b

Writing the ODE as \[ \frac {dx}{dt}+\frac {2}{t}x=4\frac {e^{t}}{t}\qquad t\neq 0 \] Show this is a linear ODE in \(x\). It is of the form \(x^{\prime }+p\left ( t\right ) x=q\relax (t) \), where \(p\relax (t) =\frac {2}{t},q\relax (t) =4\frac {e^{t}}{t}\). Hence the integrating factor is \(I=e^{\int p\relax (t) dt}=e^{\int \frac {2}{t}dt}=e^{2\ln t}\) or \(I=t^{2}\). Multiplying both sides by this integrating factor make the LHS complete differential giving\[ \frac {d}{dt}\left (xt^{2}\right ) =4te^{t}\] Integrating gives\begin {equation} xt^{2}=4\int te^{t}dt \tag {1} \end {equation} Integration by parts. \(\int udv=uv-\int vdu\). Let \(u=t,dv=e^{t},du=dt,v=e^{t}\), therefore\begin {align*} \int te^{t}dt & =te^{t}-\int e^{t}dt\\ & =te^{t}-e^{t} \end {align*}

Hence (1) becomes\[ xt^{2}=4\left (te^{t}-e^{t}\right ) +C \] Where \(C\) is constant of integration.  Therefore\begin {align*} x\relax (t) & =\frac {4\left (te^{t}-e^{t}\right ) }{t^{2}}+\frac {C}{t^{2}}\\ & =\frac {4e^{t}\left (t-1\right ) }{t^{2}}+\frac {C}{t^{2}}\qquad t\neq 0 \end {align*}

2.1.9 Problem 8

A container initially containing \(10\) L of water in which there is \(20\) g of salt dissolved. A solution containing \(4\) g/L of salt is pumped into the container at a rate of \(2\) L/min, and the well-stilled mixture runs out at a rate of \(1\) L/min. How much salt is in the tank after \(40\) min?

Solution

pict
Figure 2.2:Showing tank flow

Let \(x\relax (t) \) be mass of salt (in grams) in tank at time \(t\). Let \(V\relax (t) \) be the volume of water (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 (4\ \frac {\text {g}}{\text {L}}\right ) \text { }-\text { }\left (1\text { }\frac {\text {L}}{\text {min}}\right ) \left (\frac {x\relax (t) }{V\relax (t) }\ \frac {\text {g}}{\text {L}}\right ) \nonumber \\ & =8-\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-1\right ) t\\ & =V\relax (0) +t \end {align*}

But we are given that \(V\relax (0) =10\) L. Hence\[ V\relax (t) =10+t \] Substituting the above in (1) gives\[ \frac {dx}{dt}=8-\frac {x}{10+t}\] The solution to above ODE gives the mass \(x\) of salt in tank at time \(t\). \[ \frac {dx}{dt}+\frac {x}{10+t}=8 \] This is linear ODE. The integrating factor is \(I=e^{\int \frac {1}{10+t}dt}=e^{\ln \left (10+t\right ) }=10+t\). Multiplying both sides of the above ODE by this integrating factor gives\[ \frac {d}{dt}\left (\left (10+t\right ) x\right ) =8\left (10+t\right ) \] Integrating gives\begin {align*} \left (10+t\right ) x & =8\int \left (10+t\right ) dt\\ & =8\left (10t+\frac {t^{2}}{2}\right ) +C \end {align*}

Hence\begin {align} x & =8\frac {t\left (10+\frac {t}{2}\right ) }{\left (10+t\right ) }+\frac {C}{\left (10+t\right ) }\nonumber \\ & =4\frac {t\left (20+t\right ) }{\left (10+t\right ) }+\frac {C}{\left ( 10+t\right ) } \tag {1} \end {align}

At \(t=0\), we are given that \(x\relax (0) =20\) (g). Hence the above becomes\begin {align*} 20 & =\frac {C}{10}\\ C & =200 \end {align*}

Therefore (1) becomes\begin {equation} x=4\frac {t\left (20+t\right ) }{\left (10+t\right ) }+\frac {200}{\left ( 10+t\right ) } \tag {2} \end {equation} At \(t=40\), the above gives\begin {align*} x\left (40\right ) & =4\frac {40\left (20+40\right ) }{\left ( 10+40\right ) }+\frac {200}{\left (10+40\right ) }\\ & =196\text { grams} \end {align*}

2.1.10 Problem 9

Consider the RC circuit (See page 65 in the text) which has \(R=5\Omega ,C=\frac {1}{50}F\) and \(E\relax (t) =100V\). If the capacitor is uncharged initially, determine the current in the circuit for \(t\geq 0.\)

Solution

The equation for RC circuit is given by equation 1.7.16 in the text book as \[ \frac {dq}{dt}+\frac {1}{RC}q=\frac {E\relax (t) }{R}\] Where \(q\relax (t) \) is the charge on the plates of the capacitor We are told that at \(t=0,q=0\). Using the numerical values given, the above ODE becomes\begin {align*} \frac {dq}{dt}+\frac {1}{5\left (\frac {1}{50}\right ) }q & =\frac {100}{5}\\ \frac {dq}{dt}+10q & =20 \end {align*}

This is linear ODE in \(q\). The integrating factor is \(I=e^{\int 10dt}=e^{10t}\). Multiplying both sides by this integrating factor gives\[ \frac {d}{dt}\left (qe^{10t}\right ) =20e^{10t}\] Integrating\begin {align*} qe^{10t} & =20\int e^{10t}dt\\ & =20\frac {e^{10t}}{10}+C \end {align*}

Hence\[ q\relax (t) =2+Ce^{-10t}\] Using initial conditions \(q\relax (0) =0\) shows that \(0=2+C\) or \(C=-2\). Hence\begin {align*} q\relax (t) & =2-2e^{-10t}\\ & =2\left (1-e^{-10t}\right ) \end {align*}

Hence the current in the circuit is\begin {align*} i\relax (t) & =\frac {dq}{dt}\\ & =2\frac {d}{dt}\left (1-e^{-10t}\right ) \\ & =2\left (10e^{-10t}\right ) \\ & =20e^{-10t} \end {align*}

2.1.11 Problem 10

Solve the initial-value problem\begin {align*} \frac {dy}{dx} & =\frac {2x-y}{x+4y}\\ y\relax (1) & =1 \end {align*}

Solution

Let us first check if a solution exists, and unique. \(f\left (x,y\right ) =\frac {2x-y}{x+4y}\). This is continuos for all \(x,y\) except when \(y=-\frac {1}{4}x\). And \(\frac {\partial f}{\partial y}=\frac {-9x}{\left (x+4y\right ) ^{2}}\). This is also continuos for all \(x,y\) except when \(y=-\frac {1}{4}x\). Since initial conditions satisfies \(y\neq -\frac {1}{4}x\), then there is an interval \(I\) that includes \(x_{0}=0\) where a solution exists and is unique for all \(x\) in this interval. Now we can solve the ODE.

Let \(v=\frac {y}{x}\). Hence \(y=xv\). Therefore \(\frac {dy}{dx}=v+x\frac {dv}{dx}\). The given ODE can be written as\[ \frac {dy}{dx}=\frac {2-\frac {y}{x}}{1+4\frac {y}{x}}\qquad x\neq 0 \] In terms of the new dependent variable \(v\relax (x) \), the above becomes\begin {align*} v+x\frac {dv}{dx} & =\frac {2-v}{1+4v}\\ x\frac {dv}{dx} & =\frac {2-v}{1+4v}-v\\ & =\frac {\left (2-v\right ) -v\left (1+4v\right ) }{1+4v}\\ & =\frac {2-v-v-4v^{2}}{1+4v}\\ & =\frac {2-2v-4v^{2}}{1+4v} \end {align*}

The above ODE is separable. Therefore\[ \frac {1+4v}{2-2v-4v^{2}}dv=\frac {1}{x}dx \] Integrating gives\[ \int \frac {1+4v}{2-2v-4v^{2}}dv=\int \frac {1}{x}dx \] We notice that \(\frac {d}{dx}\ln \left (2-2v-4v^{2}\right ) =\frac {-2-8v}{2-2v-4v^{2}}\). Therefore \(-\frac {1}{2}\frac {d}{dx}\ln \left ( 2-2v-4v^{2}\right ) =\frac {1+4v}{2-2v-4v^{2}}\) which is the integrand. This shows that \(-\frac {1}{2}\ln \left (2-2v-4v^{2}\right ) \) is the anti derivative of the integral of the LHS above. Therefore the above becomes\begin {align*} -\frac {1}{2}\ln \left (2-2v-4v^{2}\right ) & =\ln x+C_{1}\\ \ln \left (2-2v-4v^{2}\right ) & =-2\ln x-2C_{1}\\ 2-2v-4v^{2} & =e^{-2C_{1}}\frac {1}{x^{2}} \end {align*}

Let \(c=e^{-2C_{1}}\) be new constant.  The above becomes\begin {align*} 2-2v-4v^{2} & =\frac {c}{x^{2}}\\ 4v^{2}+2v-2+\frac {c}{x^{2}} & =0\\ v^{2}+\frac {1}{2}v-\frac {1}{2}+\frac {c}{4x^{2}} & =0 \end {align*}

Solving for \(v\) gives\begin {align*} v & =-\frac {b}{2a}\pm \frac {1}{2a}\sqrt {b^{2}-4ac}\\ & =-\frac {1}{4}\pm \frac {1}{2}\sqrt {\frac {1}{4}-4\left (-\frac {1}{2}+\frac {c}{4x^{2}}\right ) }\\ & =-\frac {1}{4}\pm \frac {1}{2}\sqrt {\frac {1}{4}+2-\frac {c}{x^{2}}}\\ & =-\frac {1}{4}\pm \frac {1}{2}\sqrt {\frac {9}{4}-\frac {c}{x^{2}}}\\ & =-\frac {1}{4}\pm \frac {1}{2}\sqrt {\frac {9x^{2}-4c}{4x^{2}}}\\ & =-\frac {1}{4}\pm \frac {1}{4x}\sqrt {9x^{2}-4c}\qquad x>0 \end {align*}

Since \(v=\frac {y}{x}\), then there are two general solutions\begin {align*} y_{1}\relax (x) & =-\frac {1}{4}+\frac {1}{4x}\sqrt {9x^{2}-4c}\\ y_{2}\relax (x) & =-\frac {1}{4}-\frac {1}{4x}\sqrt {9x^{2}-4c} \end {align*}

Initial conditions are now used to find a particular soluton. For \(y_{1}\relax (x) \)\begin {align*} 1 & =-\frac {1}{4}+\frac {1}{4}\sqrt {9-4c}\\ \frac {5}{4} & =\frac {1}{4}\sqrt {9-4c}\\ 5 & =\sqrt {9-4c}\\ 25 & =9-4c\\ c & =-4 \end {align*}

Hence one solution is \[ y_{1}\relax (x) =-\frac {x}{4}+\frac {1}{4}\sqrt {9x^{2}+16}\] And for \(y_{2}\relax (x) \)\begin {align*} 1 & =-\frac {1}{4}-\frac {1}{4}\sqrt {9-4c}\\ \frac {5}{4} & =-\frac {1}{4}\sqrt {9-4c}\\ -5 & =\sqrt {9-4c} \end {align*}

There is no solution for \(c\) in this equation since sqrt of a real number must be positive (principal root). Hence the only particular solution is the first one which is\[ \fbox {$y_1\relax (x) =-\frac {x}{4}+\frac {1}{4}\sqrt {9x^2+16}$}\] The above verifies the existence and uniqueness theorem, as only one solution is found which includes \(x_{0}=1\).

2.1.12 Problem 11

Solve the given differential equation

\[ y^{\prime }+2\frac {y}{x}=6y^{2}x^{4}\] Solution

In canonical form the ODE is\[ y^{\prime }=-\frac {2}{x}y+6x^{4}y^{2}\] We see that this is Bernoulli ODE of the form \(y^{\prime }=p\left ( x\right ) y+q\relax (x) y^{n}\) where \(n=2\). Dividing both sides by \(y^{2}\) gives\[ \frac {y^{\prime }}{y^{2}}+\frac {2}{x}\frac {1}{y}=6x^{4}\] Let \(v=\frac {1}{y}\). Then \(\frac {dv}{dx}=-\frac {1}{y^{2}}\frac {dy}{dx}\). Or \(\frac {dy}{dx}=-y^{2}\frac {dv}{dx}\). Substituting this in the above ODE gives\begin {align*} -y^{2}\frac {dv}{dx}\frac {1}{y^{2}}+\frac {2}{x}v & =6x^{4}\\ \frac {dv}{dx}-\frac {2}{x}v & =-6x^{4} \end {align*}

This is now linear in \(v\). The integrating factor is \(I=e^{\int -\frac {2}{x}dx}=e^{-2\ln x}=\frac {1}{x^{2}}\). Multiplying both sides by this integrating factor gives\[ \frac {d}{dx}\left (\frac {v}{x^{2}}\right ) =-6x^{2}\] Integrating\begin {align*} \frac {v}{x^{2}} & =-6\int x^{2}dx+C\\ & =-2x^{3}+C\\ v & =-2x^{5}+Cx^{2} \end {align*}

But \(y=\frac {1}{v}\). Therefore the final solution is\[ y\relax (x) =\frac {1}{-2x^{5}+Cx^{2}}\]

2.1.13 Problem 12

Determine whether the given differential equation is exact\[ 2xe^{y}dx+\left (3y^{2}+x^{2}e^{y}\right ) dy=0 \] Solution

Writing the ODE as\[ M\left (x,y\right ) dx+N\left (x,y\right ) dy=0 \] Where\begin {align*} M & =2xe^{y}\\ N & =3y^{2}+x^{2}e^{y} \end {align*}

Therefore\begin {align*} \frac {\partial M}{\partial y} & =2xe^{y}\\ \frac {\partial N}{\partial x} & =2xe^{y} \end {align*}

Since \(\frac {\partial M}{\partial y}=\frac {\partial N}{\partial x}\) then the ode is exact.

2.1.14 Problem 13

Solve the given differential equation

\begin {equation} \left (y^{2}+\cos x\right ) dx+\left (2xy+\sin y\right ) dy=0 \tag {1} \end {equation} Solution

The first step is to determine if the ODE is exact or not. Writing the ODE as\[ M\left (x,y\right ) dx+N\left (x,y\right ) dy=0 \] Therefore\begin {align*} \frac {\partial M}{\partial y} & =2y\\ \frac {\partial N}{\partial x} & =2y \end {align*}

Since \(\frac {\partial M}{\partial y}=\frac {\partial N}{\partial x}\), then the ODE is exact. This implies there exists potential function \(\phi \left (x,y\right ) \) such that its differential is\begin {align} d\phi & =\frac {\partial \phi }{\partial x}dx+\frac {\partial \phi }{\partial y}dy\tag {2}\\ & =0\nonumber \end {align}

This implies \(\phi \left (x,y\right ) =C_{1}\). Comparing (1,2) shows that\begin {align} \frac {\partial \phi }{\partial x} & =M\tag {3}\\ \frac {\partial \phi }{\partial y} & =N \tag {4} \end {align}

Integrating (3) w.r.t. \(x\) gives\[ \phi =\int Mdx+f\relax (y) \] Where \(f\relax (y) \) acts as the integration constant, but since \(\phi \) depends on both \(x,y\), it becomes an arbitrary function of \(y\) instead. The above becomes\begin {align} \phi & =\int \left (y^{2}+\cos x\right ) dx+f\relax (y) \nonumber \\ & =xy^{2}+\sin x+f\relax (y) \tag {5} \end {align}

Taking derivative w.r.t. \(y\) of the above gives\begin {equation} \frac {\partial \phi }{\partial y}=2xy+f^{\prime }\relax (y) \tag {6} \end {equation} Comparing (6) and (4) shows that\begin {align*} N & =2xy+f^{\prime }\relax (y) \\ 2xy+\sin y & =2xy+f^{\prime }\relax (y) \\ \sin y & =f^{\prime }\relax (y) \end {align*}

Therefore \(f\relax (y) =-\cos x+C_{2}\) where \(C_{2}\) is arbitrary constant. Substituting \(f\relax (y) \) back in (5) gives\[ \phi \left (x,y\right ) =xy^{2}+\sin x-\cos x+C_{2}\] But since \(\phi \left (x,y\right ) \) is a constant function, say \(C_{1}\) then the above becomes\[ \fbox {$xy^2+\sin x-\cos x=C$}\] Where the constants \(C_{1},C_{2}\) are combined to one constant \(C\). The above is the solution to the ODE. It can be left in implicit form as the above, or we can solve for \(y\) explicitly. Solving for \(y\) gives\[ y^{2}=\frac {C+\cos x-\sin x}{x}\] Hence\[ y\relax (x) =\pm \sqrt {\frac {C+\cos x-\sin x}{x}}\qquad x\neq 0 \]

2.1.15 Problem 14

Determine an integrating factor for the given differential equation and hence find the general solution\begin {equation} \left (xy-1\right ) dx+x^{2}dy=0 \tag {1} \end {equation} Solution

Writing the ODE as\[ M\left (x,y\right ) dx+N\left (x,y\right ) dy=0 \] Where\begin {align*} M & =xy-1\\ N & =x^{2} \end {align*}

Therefore\begin {align*} \frac {\partial M}{\partial y} & =x\\ \frac {\partial N}{\partial x} & =2x \end {align*}

Since \(\frac {\partial M}{\partial y}\neq \frac {\partial N}{\partial x}\) then the ode is not exact. Applying theorem 1.9.11 part(1). \begin {align*} \frac {M_{y}-N_{x}}{N} & =\frac {x-2x}{x^{2}}\\ & =-\frac {1}{x}\\ & =f\relax (x) \end {align*}

Since this depends on \(x\) only, then there exists an integrating factor that depends on \(x\) only which makes the ODE exact. The integrating factor is therefore\begin {align*} I & =e^{\int f\relax (x) dx}\\ & =e^{\int -\frac {1}{x}dx}\\ & =e^{-\ln x}\\ & =\frac {1}{x} \end {align*}

Multiplying the given ODE (1) by this integrating factor gives\begin {align*} \frac {1}{x}\left (xy-1\right ) dx+\frac {1}{x}x^{2}dy & =0\\ \left (y-\frac {1}{x}\right ) dx+xdy & =0 \end {align*}

Where now \begin {align*} M & =y-\frac {1}{x}\\ N & =x \end {align*}

Let us first verify the above is indeed exact.\begin {align*} \frac {\partial M}{\partial y} & =1\\ \frac {\partial N}{\partial x} & =1 \end {align*}

This shows it is exact as expected. Hence now we need to find \(\phi \left ( x,y\right ) \) by solving the following two equations \begin {align} \frac {\partial \phi }{\partial x} & =M=y-\frac {1}{x}\tag {3}\\ \frac {\partial \phi }{\partial y} & =N=x \tag {4} \end {align}

Integrating (3) w.r.t. \(x\) gives\[ \phi =\int Mdx+f\relax (y) \] Where \(f\relax (y) \) acts as the integration constant, but since \(\phi \) depends on both \(x,y\), it becomes an arbitrary function of \(y\) instead. The above becomes\begin {align} \phi & =\int \left (y-\frac {1}{x}\right ) dx+f\relax (y) \nonumber \\ & =xy-\ln x+f\relax (y) \tag {5} \end {align}

Taking derivative w.r.t. \(y\) of the above gives\begin {equation} \frac {\partial \phi }{\partial y}=x+f^{\prime }\relax (y) \tag {6} \end {equation} Comparing (6) and (4) shows that\begin {align*} N & =x+f^{\prime }\relax (y) \\ x & =x+f^{\prime }\relax (y) \\ 0 & =f^{\prime }\relax (y) \end {align*}

Therefore \(f\relax (y) =C_{2}\) where \(C_{2}\) is arbitrary constant. Substituting \(f\relax (y) \) back in (5) gives\[ \phi \left (x,y\right ) =xy-\ln x+C_{2}\] But since \(\phi \left (x,y\right ) \) is a constant function, say \(C_{1}\) then the above becomes\[ xy-\ln x=C \] Where the constants \(C_{1},C_{2}\) are combined to one constant \(C\). Solving for \(y\) gives\[ \fbox {$y=\frac {C+\ln x}{x}$}\]

Where \(x\neq 0\)

2.1.16 Marks per problem

pict
Figure 2.3:marks