Title: Default for 19.2 First Order Differential Equations
Course: HELM Workbooks 2023-2024

Separating the variables in first order ODEs

In this Section we consider differential equations which can be written in the form \[\dfrac{\mathrm{d}y}{\mathrm{d}x}=f(x)g(y). \] Note that the right-hand side is a product of a function of \(x\), and a function of \(y\). Examples of such equations are \[ \dfrac{\mathrm{d}y}{\mathrm{d}x}= x^2,y^3,\quad \dfrac{\mathrm{d}y}{\mathrm{d}x}=y^2x \quad \text{and} \quad \dfrac{\mathrm{d}y}{\mathrm{d}x} =yx. \] Not all first order equations can be written in this form. For example, it is not possible to rewrite the equation \[\dfrac{\mathrm{d}y}{\mathrm{d}x} = x^2+y^3\] in the form \[\dfrac{\mathrm{d}y}{\mathrm{d}x}=f(x)g(y).\]

Different variable names

The variables involved in differential equations need not be \(x\) and \(y\). Any symbols for variables may be used. Other first order differential equations are \[\dfrac{\mathrm{d}z}{\mathrm{d}t}=te^z,\quad \dfrac{\mathrm{d}\theta}{\mathrm{d}t} =- \theta \quad \text{and} \quad \dfrac{\mathrm{d}v}{\mathrm{d}r}=v\left({\dfrac{1}{r^2}}\right). \] Given a differential equation in the form \[\dfrac{\mathrm{d}y}{\mathrm{d}x}=f(x)g(y),\] we can divide through by \(g(y)\) to obtain \[\dfrac{1}{g(y)}\dfrac{\mathrm{d}y}{\mathrm{d}x}=f(x). \] If we now integrate both sides of this equation with respect to \(x\) we obtain \[ \int \dfrac{1}{g(y)}\dfrac{\mathrm{d}y}{\mathrm{d}x}\, \mathrm{d}x=f(x) \,\mathrm{d}x \] that is \[ \int \dfrac{1}{g(y)} \, \mathrm{d}y = f(x)\, \mathrm{d}x. \] We have seperated the variables because the left-hand side contains only the variable \(y\), and the right-hand side contains only the variable \(x\). We can now try to integrate each side separately. If we can actually perform the required integrations we will obtain a relationship between \(y\) and \(x\). Examples of this process are given in the next subsection.

Method of Separation of Variables:

Key Point

The solution of the equation \[ {\mathrm{d}y\over \mathrm{d}x}=f(x)g(y) \] may be found from separating the variables and integrating: \[ \int {1\over g(y)}\,\mathrm{d}y=\int f(x)\,\mathrm{d}x \]

Applying the method of separation of variables to ODEs

Example

Use the method of separation of variables to solve the differential equation \[ \dfrac{\mathrm{d}y}{\mathrm{d}x}=\dfrac{3x^2}{y}.\]

Solution

The equation already has the form \[\dfrac{\mathrm{d}y}{\mathrm{d}x}=f(x)g(y)\] where\[f(x)=3x^2\quad \text{and} \quad g(y)=1/y.\] Dividing both sides by \(g(y)\) we find \[y\dfrac{\mathrm{d}y}{\mathrm{d}x} = 3x^2. \] Integrating both sides with respect to \(x\) gives \[ \int y\dfrac{\mathrm{d}y}{\mathrm{d}x} \,\mathrm{d}x = 3x^2 \,\mathrm{d}x\] that is \[ \int y\ \mathrm{d}y = \int 3x^2 \, \mathrm{d}x.\] Note that the left-hand side is an integral involving just \(y\); the right-hand side is an integral involving just \(x\). After integrating both sides with respect to the stated variables we find \[ \dfrac{1}{2} y^2 = x^3 + c \] where \(c\) is a constant of integration. (You might think that there would be a constant on the left-hand side too. You are quite right but the two constants can be combined into a single constant and so we need only write one.) We now have a relationship between \(y\) and \(x\) as required. Often it is sufficient to leave your answer in this form but you may also be required to obtain an explicit relation for \(y\) in terms of \(x\). In this particular case \[y^2=2x^3+2c\] so that \[y=\pm \sqrt{2x^3+2c} .\]

Exact equations

Consider the differential equation \[\dfrac{\mathrm{d}y}{\mathrm{d}x}=3x^2.\] By direct integration we find that the general solution of this equation is \[y=x^3+C, \] where \(C\) is, as usual, an arbitrary constant of integration.

Next, consider the differential equation \[\dfrac{\mathrm{d}}{\mathrm{d}x}(yx)=3x^2.\] Again, by direct integration we find that the general solution is \[yx=x^3+C.\]

We now divide this equation by \(x\) to obtain \[y=x^2+\dfrac{C}{x}. \] The differential equation \[\dfrac{\mathrm{d}}{\mathrm{d}x}(yx)=3x^2\] is called an exact equation. It can effectively be solved by integrating both sides.

If we consider examples of this kind in a more general setting we obtain the following Key Point:

Key Point

The solution of the equation \[\dfrac{\mathrm{d}}{\mathrm{d}x}(f(x)\cdot y)=g(x) \] is \[f(x)\cdot y=\int g(x)\, \mathrm{d}x \quad \text{or}\quad y=\dfrac{1}{f(x)}\int g(x) \, \mathrm{d}x. \]

Solving exact equations

As we have seen, the differential equation \( \dfrac{\mathrm{d}}{\mathrm{d}x}(yx)=3x^2\) has solution \(y=x^2+C/x \). In the solution, \(x^2\) is called the definite part and \(C/x\) is called the indefinite part (containing the arbitrary constant of integration). If we take the definite part of this solution, i.e. \(y_\text{d}=x^2\), then \[ \dfrac{\mathrm{d}}{\mathrm{d}x}(y_\text{d}\cdot x)=\dfrac{\mathrm{d}}{\mathrm{d}x}(x^2\cdot x)=\dfrac{\mathrm{d}}{\mathrm{d}x}(x^3)=3x^2.\] Hence \(y_\text{d}=x^2\) is a solution of the differential equation.

Now if we take the indefinite part of the solution i.e. \(y_\text{i}=C/x\) then \[ \dfrac{\mathrm{d}}{\mathrm{d}x}(y_\text{i}\cdot x)=\dfrac{\mathrm{d}}{\mathrm{d}x}\left({C\over x}\cdot x\right)=\dfrac{\mathrm{d}}{ \mathrm{d}x}(C)=0.\] It is always the case that the general solution of an exact equation is in two parts: a definite part \(y_\text{d}(x)\)which is a solution of the differential equation and an indefinite part \(y_\text{i}(x)\) which satisfies a simpler version of the differential equation in which the right-hand side is zero.

Recognising an exact equation

The equation \(\dfrac{\mathrm{d}}{\mathrm{d}x}(yx)=3x^2\) is exact, as we have seen. If we expand the left-hand side of this equation (i.e. differentiate the product) we obtain \[ x \dfrac{\mathrm{d}y}{\mathrm{d}x}+y.\] Hence the equation \[ x \dfrac{\mathrm{d}y}{\mathrm{d}x}+y=3x^2\] must be exact, but it is not so obvious that it is exact as in the original form. This leads to the following Key Point:

Key Point

The equation \[ f(x){\mathrm{d}y\over \mathrm{d}x}+y\ f'(x)=g(x)\] is exact. It can be re-written as \[\dfrac{\mathrm{d}}{\mathrm{d}x}(y\, f(x))=g(x) \quad\text{so that}\quad y\, f(x)=\int g(x)\, \mathrm{d}x .\]

Example

Solve the equation \[ x^3 \dfrac{\mathrm{d}y}{\mathrm{d}x}+3x^2y=x\]

Solution

Comparing this equation with the form in the Key Point before we see that \(f(x)=x^3\) and \(g(x)=x\). Hence the equation can be written \[ \dfrac{\mathrm{d}}{\mathrm{d}x}(yx^3)=x,\] which has solution \[yx^3=\int x\, \mathrm{d}x=\dfrac{1}{2}x^2+C.\]Therefore \[ y=\dfrac{1}{2x}+\dfrac{C}{x^3}.\]

Exercise

Determine which of the following differential equations can be written in the form \[\dfrac{\mathrm{d}y}{\mathrm{d}x}=f(x)g(y).\]

1. \(\dfrac{\mathrm{d}y}{\mathrm{d}x}=\dfrac{[value]x^2}{y^2}\)
2. \(\dfrac{\mathrm{d}y}{\mathrm{d}x}=[value]x^2+2y^2\)
3. \(y\dfrac{\mathrm{d}y}{\mathrm{d}x} +3x =[value]\)
Feedback: We are asked to determine which of the following differential equations can be written in the form \[\dfrac{\mathrm{d}y}{\mathrm{d}x}=f(x)g(y).\] 1. \(\dfrac{\mathrm{d}y}{\mathrm{d}x}=\dfrac{[value]x^2}{y^2} =[value]x^2\left(\dfrac{1}{y^2}\right),\) with \(f(x) = [value]x^2\) and \( g(y) = \dfrac{1}{y^2}. \) 2. It cannot be written in this form. 3. \(y\dfrac{\mathrm{d}y}{\mathrm{d}x} +3x =[value].\) Reformulating gives \( \dfrac{\mathrm{d}y}{\mathrm{d}x}=([value]-3x)\times \dfrac{1}{y},\) with \(f(x) = ([value]-3x)\) and \( g(y) = \dfrac{1}{y}. \)

Exercise

Use the method of separation of variables to solve the differential equation \[ \dfrac{\mathrm{d}y}{\mathrm{d}x}=\dfrac{[value]\cos( x)}{ \sin ([value]y)}.\]

First rearrange the equation to the form \(f(y)\dfrac{\mathrm{d}y}{\mathrm{d}x} = g(x) + C\), where \(f(y)\) is a function of \(y\) and \(g(x)\) is a function of \(x\).

\(\dfrac{\mathrm{d}y}{\mathrm{d}x}\) \(=\) \(+C\) ,where \(C\) is an arbitrary constant.

Now reformulate both sides of the equation as integrals and subsequently integrate both sides. Give your answer in the form \(f(y) = g(x) + C\).

\(=\) \(+C\)

Finally, rearrange the equation to obtain an expression for \(y\) in terms of \(x\).

\(y =\) \(\cos^{-1}(D +\) \( ) \), where \(D = -[value]C\)
Feedback: We are given the differential equation \[ \dfrac{\mathrm{d}y}{\mathrm{d}x}=\dfrac{[value]\cos( x)}{ \sin ([value]y)}.\] First separate the variables so that terms involving \(y\) and \(\dfrac{\mathrm{d}y}{\mathrm{d}x}\) appear on the left, and terms involving \(x\) appear on the right. You should have obtained: \[ \sin ([value]y)\,\dfrac{\mathrm{d}y}{\mathrm{d}x}=[value]\cos(x).\] Now reformulate both sides as integrals: \[\int \sin ([value]y)\,\dfrac{\mathrm{d}y}{\mathrm{d}x}\,\mathrm{d}x=\int[value]\cos(x)\,\mathrm{d}x \quad\text{that is}\quad \int \sin ([value]y)\,\mathrm{d}y=\int [value]\cos( x)\, \mathrm{d}x.\] Now integrate both sides: \[-\dfrac{1}{[value]}\cos([value]y)=[value]\sin (x)+C.\] Finally, you can rearrange to obtain an expression for \(y\) in terms of \(x.\) \[ y = [value]\cos^{-1}(D [value]).\]

Exercise

Solve the following equations. \(C\) is an arbitrary constant.

1. \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = [value]x^4\), \(y = \) \(+ C\)
2. \(\dfrac{\mathrm{d}}{\mathrm{d}x}([value]x^3y) = [value]x^4\), \(y =\) \(+ \dfrac{C}{[value]x^3}\)
Feedback: 1. Integrating both sides with respect to \(\mathrm{d}x\) gives \[\int \mathrm{d}y = \int [value]x^4 \, \mathrm{d}x\] which also gives \(y = \displaystyle [value] +C.\) 2. Integrating both sides with respect to \(\mathrm{d}x\) gives \[\int d([value]x^3y) =\int [value]x^4 \, \mathrm{d}x\] which becomes \[[value]x^3y = \dfrac{[value]}{5}x^5 +C.\] We then make \(y\) the subject to get \(y = \displaystyle [value]+ \dfrac{C}{[value]x^3}.\)

Exercise

Solve the differential equation \[\dfrac{\mathrm{d}}{\mathrm{d}x}(y \cos([value]x)) = [value]\cos([value]x)\]

\(y=\) \(+ C \sec([value]x)\)

where \(C\) is an arbitrary constant.
Feedback: We are given the differential equation \[\dfrac{\mathrm{d}}{\mathrm{d}x}(y \cos([value]x)) = [value]\cos([value]x)\] Integrating both sides with respect to \(\mathrm{d}x\) gives \[\int d(y \cos([value]x)) \, \mathrm{d}x = \int [value] \cos([value]x) \, \mathrm{d}x.\] Then we have \[ y \cos([value]x) = \dfrac{[value]\sin([value]x)}{[value]} + C.\] You can now make \(y\) the subject to get \[y = [value] + C \sec([value]x).\]

Exercise

Write the exact form of the following equation and obtain its solution,\[e^{[value]x} \dfrac{\mathrm{d}y}{\mathrm{d}x} + [value]e^{[value]x} = [value]x^2.\]

Exact form: \( \dfrac{\mathrm{d}}{\mathrm{d}x}(\)) \(= [value]x^2. \)

\(y=\) \(+Ce^{[value]x}\), where \(C\) ia an arbitrary constant.
Feedback: We are given the differential equation \[e^{[value]x} \dfrac{\mathrm{d}y}{\mathrm{d}x} + [value]e^{[value]x} = [value]x^2.\] The equation is of an exact form since it can be written as \[ f(x) \dfrac{\mathrm{d}y}{\mathrm{d}x} + y f^{\prime}(x) = g(x)\] with \[f(x) = e^{[value]x} \quad \text{and} \quad g(x)=[value]x^2.\] hence the exact form becomes \[\dfrac{\mathrm{d}}{\mathrm{d}x}(yf(x)) = g(x), \quad \text{i.e} \quad \dfrac{\mathrm{d}}{\mathrm{d}x}(ye^{[value]x}) = [value]x^2.\] Now integrating gives \[ ye^{[value]x} = \int [value]x^2 \, \mathrm{d}x \] which implies \[ ye^{[value]x} = [value] \dfrac{x^3}{3} + C.\] You can now make \(y\) the subject to get \[ y = [value] + Ce^{[value]x}.\]

The Integrating factor

The equation\[x^2{\mathrm{d}y\over \mathrm{d}x}+3x\ y=x^3\] is not exact. However, if we multiply it by \(x\) we obtain the equation \[ x^3{\mathrm{d}y\over \mathrm{d}x}+3x^2y=x^4.\] This can be re-written as \[ {\mathrm{d}\over \mathrm{d}x} (x^3y)=x^4\] which is an exact equation with solution \[ x^3y=\int x^4 \,\mathrm{d}x\] so \[x^3y={1\over 5}x^5+C\] and hence \[ y={1\over 5}x^2+{C\over x^3}.\] The function by which we multiplied the given differential equation in order to make it exact is called an integrating factor. In this example the integrating factor is simply \(x\).

Exercise

Which of the following differential equations can be made exact by multiplying by \(x^2\)?

1. \(\dfrac{\mathrm{d}y}{\mathrm{d}x}+\dfrac{2}{x}y=4\)
2. \(x \dfrac{\mathrm{d}y}{\mathrm{d}x}+3y=x^2\)
3. \(\dfrac{1}{x} \dfrac{\mathrm{d}y}{\mathrm{d}x}-\dfrac{1}{x^2}y=x\)
4. \(\dfrac{1}{x}\dfrac{\mathrm{d}y}{\mathrm{d}x}+\dfrac{1}{x^2} y=3.\)
Feedback: 1. [value]. \(x^2\dfrac{\mathrm{d}y}{\mathrm{d}x}+2xy=4x^2\) becomes \(\dfrac{\mathrm{d}}{\mathrm{d}x}(x^2y)=4x^2\). 2. [value]. \(x^3\dfrac{\mathrm{d}y}{\mathrm{d}x}+3x^2y=x^4\) becomes \(\dfrac{\mathrm{d}}{\mathrm{d}x}(x^3y)=x^4\). 3. [value]. This equation is already exact as it can be written in the form \(\dfrac{\mathrm{d}}{\mathrm{d}x}\left(\dfrac{1}{x} y\right)=x\) 4. [value]. \(x\dfrac{dy}{dx}+y=3x^2\) becomes \(\dfrac{d}{dx}(xy)=3x^2\).

Finding the integrating factor for linear ODEs

The differential equation governing the current \(i\) in a circuit with inductance \(L\) and resistance \(R\) in series subject to a constant applied electromotive force \(E\cos\omega t\), where \(E\) and \(\omega\) are constants, is \[ L \dfrac{\mathrm{d}i}{\mathrm{d}t}+Ri=E\cos \omega t. \quad \quad (1)\]

This is an example of a linear differential equation in which \(i\) is the dependent variable and \(t\) is the independent variable. The general standard form of a linear first order differential equation is normally written with '\(y\)' as the dependent variable and with '\(x\)' as the independent variable and arranged so that the coefficient of \(\dfrac{\mathrm{d}y}{\mathrm{d}x}\) is \(1\). That is, it takes the form: \[ \dfrac{\mathrm{d}y}{\mathrm{d}x}+f(x)y=g(x) \quad \quad (2)\]  in which \(f(x)\) and \(g(x)\) are functions of \(x\).

Comparing (1) and (2), \(x\) is replaced by \(t\) and \(y\) by \(i\) to produce \[\dfrac{\mathrm{d}i}{\mathrm{d}t}+f(t)\ i=g(t).\] The function \(f(t)\) is the coefficient of the dependent variable in the differential equation. We shall describe the method of finding the integrating factor for (1) and then generalise it to a linear differential equation written in standard form.

Step 1 Write the differential equation in standard form i.e. with the coefficient of the derivative equal to \(1\). Here we need to divide through by \(L\): \[ \dfrac{\mathrm{d}i}{\mathrm{d}t}+\dfrac{R}{L}i= \dfrac{E}{L}\cos \omega t.\]

Step 2 Integrate the coefficient of the dependent variable (that is, \(f(t)= R/L\)) with respect to the independent variable (that is, \(t\)), and ignoring the constant of integration \[ \int \dfrac{R}{L}\, \mathrm{d}t= \dfrac{R}{L} t.\]

Step 3\quad Take the exponential of the function obtained in Step 2.

This is the integrating factor (I.F.) \[ \text{I.F.} =\text{e}^{Rt/L}.\]

This leads to the following Key Point on integrating factors:

Key Point

The linear differential equation (written in standard form): \[\dfrac{\mathrm{d}y}{\mathrm{d}x}+f(x)y=g(x)\qquad \text{has an integrating factor}\qquad \text{I.F.} = \text{exp}\left[\int f(x)\mathrm{d}x\right]\] .

Exercise

Find the integrating factors for the following equations

1. \(x \dfrac{\mathrm{d}y}{\mathrm{d}x}+[value]xy=xe^{-[value]x}\), I.F \(=\)
2. \(\dfrac{\mathrm{d}y}{\mathrm{d}x}-(\tan( x))y=[value]\), I.F \(=\)
Feedback: 1. We are given \(x \dfrac{\mathrm{d}y}{\mathrm{d}x}+[value]xy=xe^{-[value]x}\). Step 1: Divide by \(x\) to get \( \dfrac{\mathrm{d}y}{\mathrm{d}x}+[value]y=e^{-[value]x}\) Step 2: The coefficient of the independent variable is \([value]\), hence \( \displaystyle\int [value]\, \mathrm{d}x=[value]x\) Step 3: I.F \(= [value]\) 2. We are given \(\dfrac{\mathrm{d}y}{\mathrm{d}x}-(\tan( x))y=[value]\). Step 1: It is already in standard form Step 2: The coefficient of the independent variable is \(-\tan( x)\), hence \( \displaystyle\int (-\tan( x))\, \mathrm{d}x=\ln( \cos (x)) \) Step 3: I.F \(=e^{\ln (\cos( x))}= [value]\)

Solving equations via the integrating factor

Having found the integrating factor for a linear equation we now proceed to solve the equation.

Returning to the differential equation, written in standard form: \[\dfrac{\mathrm{d}i}{\mathrm{d}t}+{R\over L}i={E\over L}\cos\omega t\] for which the integrating factor is \[ e^{Rt/L}\] we multiply the equation by the integrating factor to obtain \[e^{Rt/L} \dfrac{\mathrm{d}i}{\mathrm{d}t}+{R\over L} e^{Rt/L} i={E\over L}e^{Rt/L}\cos\omega t.\] At this stage the left-hand side of this equation can always be simplified as follows: \[ \dfrac{\mathrm{d}}{\mathrm{d}t}(e^{Rt/L} i)={E\over L} e^{Rt/L}\cos\omega t.\] Now this is in the form of an exact differential equation and so we can integrate both sides to obtain the solution: \[ e^{Rt/L} i={E\over L}\int e{Rt/L}\cos\omega t\ \mathrm{d}t.\] All that remains is to complete the integral on the right-hand side. Using the method of integration by parts we find \[\int e^{Rt/L}\cos\omega t\ \mathrm{d} t=\dfrac{L}{ L^2\omega^2+R^2}\left[\omega L\ \sin \omega t+R\cos\omega t\right]e^{Rt/L}.\] Hence \[ e^{Rt/L}\ i={E\over L^2\omega^2+R^2}\left[\omega L\sin\omega t+R\cos\omega t\right] e^{Rt/L}+C.\] Finally \[ i={E\over L^2\omega^2+R^2}\left[\omega L\sin \omega t +R\cos\omega t\right]+C e^{-Rt/L}\] is the solution to the original differential equation. Note that, as we should expect for the solution to a first order differential equation, it contains a single arbitrary constant \(C\).

Exercise

Using the integrating factors you find, find the general solutions the following equations. Use \(C\) as the arbitary constant.

1. \(x \dfrac{\mathrm{d}y}{\mathrm{d}x}+[value]xy=xe^{-[value]x}\), \(y=\)
2. \(\dfrac{\mathrm{d}y}{\mathrm{d}x}-(\tan x)y=[value]\), \(y=\)
Feedback: 1. The standard form is \(\dfrac{\mathrm{d}y}{\mathrm{d}x}+[value]y=e^{-[value]x}\) for which the integrating factor is \(e^{[value]x}\). Then, on multiplying through by \(e^{[value]x}\) we have \[e^{[value]x}\dfrac{\mathrm{d}y}{\mathrm{d}x}+[value]e^{[value]x} y=1\] i.e.\[\dfrac{\mathrm{d}}{\mathrm{d}x}\ (e^{[value]x}y) =1\qquad \text{so that }\qquad e^{[value]x}y=x+C\] leading to\[y=(x+C)e^{-[value]x}.\] 2. The equation is in standard form and the integrating factor is \(\cos x\). Then \[\dfrac{\mathrm{d}}{\mathrm{d}x}(y\cos x )=[value]\cos x\quad \text{so that }\quad y\cos x=\int [value]\cos x\,\mathrm{d}x= [value]\sin x+C\] giving \[ y=[value]\tan x+C\sec x\]

Exercise

Solve the equation \([value]\dfrac{\mathrm{d}y}{\mathrm{d}x} + [value] = [value]\).

\([value] [value] [value]\)

\(y =\)   \(+ \dfrac{C}{[value]}\)
Feedback: Notice that in exact form \[ f(x){\mathrm{d}y\over \mathrm{d}x}+y\ f'(x)=g(x)\] here \(f(x) = [value]\) and \(g(x) = [value]\). We may rewrite the equation then as \( \dfrac{\mathrm{d}}{\mathrm{d}x}([value]) = [value]\). Integrating both sides yields \([value] = [value] + C\), where \(C\) is some constant. We may then rearrange to find \(y\). \[ y = [value]+ \frac{C}{[value]}.\]

Exercise

Solve the equation \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = \displaystyle[value]\) to obtain \(y = \pm\sqrt{A + D}\), where \(D = \displaystyle [value]C \), \(C\) is the integration constant and \(A\) is an expression to be found.

Then \(A =  \)
Feedback: We are given the equation \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = \displaystyle[value]\). We may rearrange this as \[\begin{aligned} [value]\dfrac{\mathrm{d}y}{\mathrm{d}x} &= [value], \\ \equiv \int [value] \ \mathrm{d}y &= \int [value] \ \mathrm{d}x. \end{aligned}\] Perform the integration to obtain \[\begin{aligned} [value] &= [value] + C, \\ \implies y^2 &= - [value] + [value]C, \\ \implies y &= \pm \sqrt{- [value] + [value]C} \end{aligned}\]

Exercise

Solve the equation \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = [value]\) subject to the condition \(y(0) = 1\). Note: Type "log" or "ln" to represent the natural logarithm.

\(y =\)
Feedback: We are given the equation \[ \dfrac{\mathrm{d}y}{\mathrm{d}x} = [value]\] Rearrange to obtain integrals on both sides \[\displaystyle\int [value]\ \mathrm{d}y = \displaystyle\int [value]\ \mathrm{d}x\] Perform the integration and rearrange to find \(y\). \[\begin{aligned} [value] &= [value] + C, \\ [value] &= [value] + [value]C, \\ [value] &= \log\left([value] + [value]C\right), \\ y &= [value]\log\left([value] + [value]C\right) \end{aligned}\] We are given the condition \(y(0)=1\). Substituting \(x=0\) and setting the equation equal to \(1\) we may find \(C\). \[\begin{aligned} 1 &= [value]\log([value]C), \\ \implies [value] & = [value]C, \\ \implies C &= [value] \end{aligned}\] Then substituting \(C = [value]\) into our general equation for \(y\) yields \[y = [value]\]

Exercise

Find the general solution of the following equations:

1. \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = [value]\).
\(y =\) \( + C\)
2. \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = \displaystyle[value]\).
\(\dfrac{1}{2}y^2 =\) \( + C\)
Feedback: 1. We are given the equation \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = [value]\). Rearranging this equation to obtain two integrals gives \(\displaystyle\int 1 \ \mathrm{d}y = \displaystyle\int [value] \ \mathrm{d}x\). Integrating gives \(y = [value]x + C\). 2. We are given the equation \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = \displaystyle[value]\). Rearranging this equation to obtain two integrals gives \(\displaystyle\int y \ \mathrm{d}y = \displaystyle\int [value] \ \mathrm{d}x\). Integrating gives \(\dfrac{1}{2}y^2 = [value] + C\).

Exercise

1. Find the general solution of the equation \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = t(x-[value]) \).
\(x =\) + \(Ae^{\frac{t^2}{2}}\), where \(A\) is an arbitrary constant.
2. Find the particular solution which satisfies the condition \(x(0) = [value]\).
\(x =\)
Feedback: 1. We are given the equation \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = t(x-[value]) \). Rearrange to form an integral on both sides of the equation \[\displaystyle\int \dfrac{1}{x-[value]}\ \mathrm{d}x = \displaystyle\int t \ \mathrm{d}t\] Perform the integration and rearrange to find \(x\). \[\begin{aligned} \log(x-[value]) &= \dfrac{1}{2}t^2 + C, \\ \implies x-[value] &= e^{\frac{t^2}{2}+C} = e^{\frac{t^2}{2}}e^C, \\ \implies x &= [value] + Ae^{\frac{t^2}{2}} \end{aligned}\] 2. We are given the condition \(x(0)=[value]\). Substituting \(t=0\) and \(x=[value]\) yields \( [value] = [value] + A \implies A=[value]\) Therefore the particular solution is \(x = [value].\)

Exercise

Some equations which do not appear to be separable can be made so by means of a suitable substitution. By means of the substitution \(z=\dfrac{y}{x}\) solve the equation \[\dfrac{\mathrm{d}y}{\mathrm{d}x} = \displaystyle[value]\]

Obtain the general solution for \(z\) first. \(z =\) \(\times \tan\bigg(\) \(+ [value]C\bigg) .\)

Therefore the general solution \(y =\) \(\times \tan\bigg(\) \(+ [value]C\bigg) .\)
Feedback: We are given the equation \(\dfrac{\mathrm{d}y}{\mathrm{d}x} = \displaystyle[value].\) Use the substitution \(z = \dfrac{y}{x}\) to obtain \[\dfrac{\mathrm{d}y}{\mathrm{d}x} = [value]\] Note that \[y = xz \implies \dfrac{\mathrm{d}y}{\mathrm{d}x} = \dfrac{\mathrm{d}z}{\mathrm{d}x}x + z\] Upon substitution and rearranging, our equation becomes \[\dfrac{\mathrm{d}z}{\mathrm{d}x}x = z^2 + [value] \iff \int\dfrac{1}{z^2+[value]} \ \mathrm{d}z = \int \frac{1}{x}\ \mathrm{d}x.\] Note that \( \displaystyle\int \dfrac{1}{a^2+z^2}\ \mathrm{d}z = \dfrac{1}{a}\tan^{-1}\dfrac{z}{a}.\) Peforming the integration and rearranging to find z yields \[ \begin{aligned} \dfrac{1}{[value]}\tan^{-1}\dfrac{z}{[value]} &= \log x + C, \\ \implies \tan^{-1}\dfrac{z}{[value]} &= [value]\log x + [value]C, \\ \implies \dfrac{z}{[value]} &= \tan ([value]\log x + [value]C), \\ \implies z &= [value]\tan ([value]\log x + [value]C). \end{aligned}\] Since \(z = \dfrac{y}{x}\), we have \(y = xz\). Therefore \[y = [value]x\tan ([value]\log x + [value]C).\]

Exercise

The equation \(iR + L\dfrac{\mathrm{d}i}{\mathrm{d}t} = E\) where \(R\), \(L\) and \(E\) are constants arisis in electrical circuit theory. this equation can be solved by separation of variables. Find the particular solution which satisfies the condition \(i(0) = [value]\).

\(i =\)
Feedback: We are given the equation \(iR + L\dfrac{\mathrm{d}i}{\mathrm{d}t} = E\). This is equivalent to \(L\dfrac{\mathrm{d}i}{\mathrm{d}t} = E - iR\). We can then turn both sides of the equation into integrals \[ \int \dfrac{1}{E-iR} \ \mathrm{d}i = \int \dfrac{1}{L} \ \mathrm{d}t. \] Performing the integration and rearranging we obtain \[ \begin{aligned} -\dfrac{1}{R}\log(E-iR) &= \frac{1}{L}t + C, \qquad \text{for some constant} \; C,\\ \implies \log(E-iR) &= -\frac{R}{L}t - RC, \\ \implies E - iR &= e^{-\frac{R}{L}t-RC} = Ae^{-\frac{R}{L}t}, \qquad \text{for some constant} \; A, \\ \implies iR &= E - Ae^{-\frac{R}{L}t}, \\ \implies i &= \frac{E}{R} - \frac{A}{R}e^{-\frac{R}{L}t}. \end{aligned} \] We are given the condition \(i(0) = [value]\). Substitution and rearranging yields \[ \begin{aligned} \frac{E}{R} &= [value] + \frac{A}{R}, \\ \implies A + [value]R &= E, \\ \implies A &= E - [value]R, \\ \implies i &= \frac{E}{R} - \frac{[value]}{R}e^{-\frac{R}{L}t}. \end{aligned} \]

Exercise

Solve the equation \(\dfrac{\mathrm{d}}{\mathrm{d}x}([value]) = [value]\).

\(y =\) \( + \dfrac{C}{[value]x^2}\), for some arbitrary constant \(C\).
Feedback: We are given the equation \(\dfrac{\mathrm{d}}{\mathrm{d}x}([value]) = [value]\) which is already in exact form. Then, integrating both sides of the equation and rearranging, we obtain \[\begin{aligned} [value]yx^2 &= \int [value]x^{[value]}\ \mathrm{d}x, \\ \implies [value]yx^2 &= \frac{[value]}{[value]}x^{[value]} + C, \\ \implies y &= [value]x^{[value]} + \frac{C}{[value]x^2}. \end{aligned}\]

Exercise

Solve the equation \(\dfrac{\mathrm{d}}{\mathrm{d}x}([value]) = [value]\) given the condition \(y(0) = [value]\).

\(y =\)
Feedback: We are given the equation \(\dfrac{\mathrm{d}}{\mathrm{d}x}([value]) = [value]\) which is already in exact form. Then, integrating both sides of the equation and rearranging, we obtain \[\begin{aligned} [value] &= \int [value] \ \mathrm{d}x, \\ \implies [value] &= [value]e^{2x} + C, \\ \implies y &= [value]e^x + \frac{C}{[value]}e^{-x}. \end{aligned}\] We are given the condition \(y(0) = [value]\). Substituting \(x=0\) an \(y=n\) we obtain \([value] = \displaystyle [value]+ \dfrac{C}{[value]} \implies C = \displaystyle [value]\). Therefore \(y = \displaystyle [value]\).

Exercise

Show that the equation \(x^{[value]}\dfrac{\mathrm{d}y}{\mathrm{d}x} + [value]y = [value]x^3\) is exact and obtain its solution.

Exact form: \(\dfrac{\mathrm{d}}{\mathrm{d}x} \bigg(\) \(\bigg)\)  \(= [value]x^3\).

\(y =\) \( + \dfrac{C}{x^{[value]}}\).
Feedback: We are given the equation \(x^{[value]}\dfrac{\mathrm{d}y}{\mathrm{d}x} + [value]y = [value]x^3\). The equation is of an exact form since it can be written as \[ f(x) \dfrac{\mathrm{d}y}{\mathrm{d}x} + y f^{\prime}(x) = g(x)\] with \[f(x) = x^{[value]} \quad \text{and} \quad g(x)=[value]x^3.\] Hence the exact form becomes \[\dfrac{\mathrm{d}}{\mathrm{d}x}(yf(x)) = g(x), \quad \text{i.e} \quad \dfrac{\mathrm{d}}{\mathrm{d}x}(yx^{[value]}) = [value]x^3.\] Integrating both sides gives \[ yx^{[value]} = \int [value]x^3 \ \mathrm{d}x\] which implies \[yx^{[value]} = \dfrac{[value]}{4}x^4 + C.\] Rearranging to find \(y\) we get \[y = [value] + \dfrac{C}{x^{[value]}}.\]

Exercise

1. Is the equation \(x^{[value]}\dfrac{\mathrm{d}y}{\mathrm{d}x} + [value]y = [value]x^3\) exact?
2. Multiply \(x^{[value]}\dfrac{\mathrm{d}y}{\mathrm{d}x} + [value]y  = [value]x^3\) by \(x\) and show that the resulting equation is exact and obtain its solution.
Exact form: \(\dfrac{\mathrm{d}}{\mathrm{d}x} \bigg(\)   \(\bigg) = [value]x^4\).
\(y =\) \( + \dfrac{C}{x^4}\).
Feedback: 1. We are given the equation \(x^{[value]}\dfrac{\mathrm{d}y}{\mathrm{d}x} + [value]y = [value]x^3\). It cannot be written in the form \[ f(x) \dfrac{\mathrm{d}y}{\mathrm{d}x} + y f^{\prime}(x) = g(x).\] Therefore it is not exact. 2. Multiplying the equation by \(x\) yields the equation \(x^{[value]}\dfrac{\mathrm{d}y}{\mathrm{d}x} + [value]x^{[value]}y = [value]x^4.\) The equation is of an exact form since it can be written as \[ f(x) \dfrac{\mathrm{d}y}{\mathrm{d}x} + y f^{\prime}(x) = g(x)\] with \[f(x) = x^{[value]} \quad \text{and} \quad g(x)=[value]x^4.\] Hence the exact form becomes \[\dfrac{\mathrm{d}}{\mathrm{d}x}(yf(x)) = g(x), \quad \text{i.e} \quad \dfrac{\mathrm{d}}{\mathrm{d}x}(yx^{[value]}) = [value]x^4.\] Integrating both sides gives \[ yx^{[value]} = \int [value]x^4 \ \mathrm{d}x\] which implies \[yx^{[value]} = \dfrac{[value]}{5}x^5 + C.\] Rearranging to find \(y\) we get \[y = [value] + \dfrac{C}{x^{[value]}}.\]

An RC circuit with a single frequency input

Introduction

The components in RC circuits containing resistance, inductance and capacitance can be chosen so that the circuit filters out certain frequencies from the input. A particular kind of filter circuit consists of a resistor and capacitor in series and acts as a high cut (or low pass) filter. The high cut frequency is defined to be the frequency at which the magnitude of the voltage across the capacitor (the output voltage) is \(1/ \sqrt{2}\) of the magnitude of the input voltage.

Problem in Words

Calculate the high cut frequency for an RC circuit is subjected to a single frequency input of angular frequency \(\omega\) and magnitude \(v_i\).

(a) Find the steady state solution of the equation
\[ R\frac{\mathrm{d}q}{\mathrm{d}t}+\frac{q}{C}=v_ie^{j\omega t}\]
and hence find the magnitude of

1. the voltage across the capacitor \(v_c =\dfrac{q}{C}\)
2. the voltage across the resistor \(v_R =R\ \dfrac{ \mathrm{d}q}{\mathrm{d}t}\)

(b) Using the impedance method covered in previous workbooks, confirm your results to part (a) by calculating

1. the voltage across the capacitor \(v_c\)
2. the voltage across the resistor \(v_R\) in response to a single frequency of angular frequency \(\omega\) and magnitude \(v_i\).

(c) For the case where \(R = 1\ k\Omega\) and \(C = 1\ \mu F,\) find the ratio \(\dfrac{|v_c|}{|v_i|}\) and complete the table below

\(\omega\) | \(10\) | \(10^2\) | \(10^3\) | \(10^4\) | \(10^5\) | \(10^6\)
\(\dfrac{|v_c|}{|v_i|}\) |  |  |  |  |  |

(d) Explain why the table results show that a RC circuit acts as a high-cut filter and find the value of the high-cut frequency, defined as \(f_{hc} = \omega_{hc}/2\pi,\) such that \(\dfrac{|v_c|}{|v_i|}=\dfrac{1}{\sqrt{2}}\).

Mathematical Statement of the Problem

We need to find a particular solution to the differential equation \(R\ \dfrac{\mathrm{d}q}{\mathrm{d}t}+\dfrac{q}{C}= v_ie^{j\omega t}\).

This will give us the steady state solution for the charge \(q\). Using this we can find \(v_c =\dfrac{q}{C}\) and \(v_R = R\ \dfrac{\mathrm{d}q}{\mathrm{d}t}\). These should give the same result as the values calculated by considering the impedances in the circuit. Finally we can calculate \(\dfrac{|v_c|}{|v_i|}\) and fill in the table of values as required and find the high-cut frequency from \(\dfrac{|v_c|}{|v_i|}=\dfrac{1}{\sqrt{2}}\) and \(f_{hc} = \omega_{hc}/2\pi\).

Mathematical Solution

(a) To find a particular solution, we try a function of the form \(q=c_0e^{j\omega t}\) which means that \[\qquad \dfrac{\mathrm{d}q}{\mathrm{d}t}=j\omega c_0e^{j\omega t}\].

Substituting into \(R\ \dfrac{\mathrm{d}q}{\mathrm{d}t} + \dfrac{q}{C} = v_ie^{j\omega t}\) we get

\(R j\omega c_0e^{j\omega t}+\dfrac{c_0e^{j\omega t}}{C} = v_ie^{j\omega t}\quad \Rightarrow\)\(Rj\omega c_0+\dfrac{c_0}{C} =v_i\)

\(\Rightarrow\)\(c_0=\dfrac{v_i}{Rj\omega+\frac{1}{C}}=\dfrac{Cv_i}{RC j\omega+1}\)\(\Rightarrow\) \(q=\dfrac{Cv_i}{RCj\omega+1}\ e^{j\omega t}\)

Thus

1. \(v_c =\dfrac{q}{C} =\dfrac{v_i}{RCj\omega +1}\ e^{j\omega t}\) and
2. \(v_R=\dfrac{\mathrm{d}q}{\mathrm{d}t}=\dfrac{RCv_ij\omega}{RC j \omega+1}\ e^{j\omega t}\)

(b) We use the impedance to determine the voltage across each of the elements. The applied voltage is a single frequency of angular frequency \(\omega\) and magnitude \(v_i\) such that \(V=v_ie^{j\omega t}\). For an RC circuit, the impedance of the circuit is \(Z=Z_R+Z_c\) where \(Z_R\) is the impedance of the resistor \(R\) and \(Z_c\) is the impedance of the capacitor \(Z_c= -\dfrac{j}{\omega C}\).

Therefore \(Z= R- \dfrac{j}{\omega C}\). The current can be found using \(v=Zi\) giving

\(v_ie^{j\omega t}=\left(R-\dfrac{j}{\omega C}\right)\ i\quad \Rightarrow\quad i=\dfrac{v_i e^{j\omega t}}{R-\frac{j}{\omega C}}\)

We can now use \(v_c=z_ci\) and \(v_R=z_Ri\) giving

1. \(v_c=\dfrac{q}{C}=-\dfrac{j}{\omega C}\times\dfrac{v_i}{R-\frac{j}{\omega C}}\ e^{j\omega t}=\dfrac{v_i}{RCj\omega+1}\ e^{j\omega t}\)
2. \(v_R=\dfrac{Rv_i}{R-\frac{j}{\omega C}}\ e^{j\omega t}=\dfrac{RC v_i j\omega}{RC j\omega +1}\ e^{j\omega t}\) which confirms the result in part (a) found by solving the differential equation.

(c) When \(R=1000\ \Omega\) and \(C=10^{-6}F\)

\(v_c=\dfrac{v_i}{RCj\omega +1}\ e^{j\omega t}=\dfrac{v_i}{10^{-3} j\omega +1}\ e^{j\omega t}\)

So \(\dfrac{|v_c|}{|v_i|}=\left|\dfrac{1}{10^{-3} j\omega +1}\right|\ \left|e^{j\omega t}\right|=\left|\dfrac{1}{10^{-3} j\omega +1}\right|=\dfrac{1}{\sqrt{10^{-6}\omega^2+1}}\).

The table below shows values of \(\dfrac{|v_c|}{|v_i|}\) for a range of values of \(\omega\).

\(\omega\) | 10 | \(10^2\) | \(10^3\) | \(10^4\) | \(10^5\) | \(10^6\)
\(\dfrac{|v_c|}{|v_i|}\) | 0.99995 | 0.995 | 0.707 | 0.00995 | 0.0099995 | 0.001

(d) The table above shows that a RC circuit can be used as a high-cut filter because for low values of \(\omega\), \(\dfrac{|v_c|}{|v_i|}\) is approximately 1 and for high values of \(\omega\), \(\dfrac{|v_c|}{|v_i|}\) is approximately 0. So the circuit will filter out high frequency values. \(\qquad\dfrac{|v_c|}{|v_i|}=\dfrac{1}{\sqrt{2}}\) when \(\dfrac{1}{\sqrt{10^{-6}\omega^2+1}}=\dfrac{1}{\sqrt{2}}\quad\Leftrightarrow \quad 10^{-6}\omega^2+1=2 \Leftrightarrow 10^{-6}\omega^2=1 \Leftrightarrow\omega^2=10^6\) As we are considering \(\omega\) to be a positive frequency, \(\omega=1000.\) So \(f_{hc}=\dfrac{\omega_{hc}}{2\pi}=\dfrac{1000}{2\pi}\approx 159 \; \textrm{Hz}\) .

Interpretation

We have shown that for an RC circuit finding the steady state solution of the differential equation with a single frequency input voltage yields the same result for \(\dfrac{|v_c|}{|v_i|}\) and \(\dfrac{|v_R|}{|v_i|}\) as found by working with the complex impedances for the circuit. An RC circuit can be used as a high-cut filter and in the case where \(R = 1\ k\Omega, C = 1\ \mu F\) we found the high-cut frequency to be at approximately \(159 \; \textrm{Hz} \). This means that the circuit will pass frequencies less than this value and remove frequencies greater than this value.

Exercise

The temperature \(\theta\) (measured in degrees) of a body immersed in an atmosphere of varying temperature is given by

\[\frac{\mathrm{d}\theta}{\mathrm{d}t} + [value] \theta = [value].\]

Find the temperature at time \(t\) if \(\theta = [value]^{\circ} \mathrm{C}\) when \(t = 0\).

\(\theta(t) = \)
Feedback: This is a linear differential equation that is already written in standard form. Note that here \(f(t) = [value]\) and \(g(t) = [value]\). We use the key point to find the integrating factor: \[\text{I.F.} = \exp \left[ \int f(t) \,\mathrm{d}t \right] = [value]\] Next we transform the equation into exact form by multiplying both sides with the integrating factor. It becomes: \[[value] \cdot \frac{\mathrm{d}\theta}{\mathrm{d}t} + [value] \cdot \theta = [value] \cdot ([value])\] Note that the left-hand side is the derivative of \([value] \cdot \theta\) with respect to \(t\). Our equation then becomes: \[\frac{\mathrm{d}}{\mathrm{d}t} \left( [value] \cdot \theta \right) = [value]\] Therefore, we can find an expression for \([value] \cdot \theta\) by integrating the right-hand side. This can be done using integration by parts, which you can review in previous workbooks. The result is: \[[value] \cdot \theta = [value]\] Which then gives the following general solution: \[\theta = [value]\] We can now solve for \(C\) and use the given boundary conditions: \[C = [value]\] \[\theta(0) = [value] \implies C = [value]\] This gives the particular solution we seek: \[\theta(t) = [value]\]

Exercise

In an LR circuit with applied voltage \(E = [value]\), the current \(i\) is given by

\[L\frac{\mathrm{d}i}{\mathrm{d}t} + Ri = [value].\]

If the initial current is \(i_0\), find \(i\) subsequently.

\(i(t) = \)
Feedback: This is a linear differential equation that is not in standard form. \[L\frac{\mathrm{d}i}{\mathrm{d}t} + Ri = [value]\] We must first convert it to standard form by dividing both sides by \(L\). Note that here \(f(t) = R/L\) and \(\displaystyle g(t) = [value]\). \[\frac{\mathrm{d}i}{\mathrm{d}t} + \frac{R}{L}i = [value].\] We use the key point to find the integrating factor: \[\text{I.F.} = \exp \left[ \int f(t) \,\mathrm{d}t \right] = [value]\] Next we transform the equation into exact form by multiplying both sides with the integrating factor. It becomes: \[[value] \cdot \frac{\mathrm{d}i}{\mathrm{d}t} + \frac{R}{L} [value] \cdot i = [value] \cdot \left([value]\right)\] Note that the left-hand side is the derivative of \([value] \cdot i\) with respect to \(t\). Our equation then becomes: \[\frac{\mathrm{d}}{\mathrm{d}t} \left( [value] \cdot i \right) = [value]\] Therefore, we can find an expression for \([value] \cdot i\) by integrating the right-hand side. The result is: \[[value] \cdot i = [value]\] Which then gives the following general solution: \[i = [value]\] We can now solve for \(C\) and use the given boundary conditions: \[C = [value]\] \[i(0) = i_0 \implies C = [value]\] This gives the particular solution we seek: \[i(t) = [value]\]

Exercise

Solve the equation \(x^2\dfrac{\mathrm{d}y}{\mathrm{d}x} + xy = [value]\).

\(y =\) \( + \dfrac{C}{x}\).
Feedback: We are given the equation \(x^2\dfrac{\mathrm{d}y}{\mathrm{d}x} + xy = [value]\). Divide through by \(x^2\) to obtain the standard form of the equation \[ \dfrac{\mathrm{d}y}{\mathrm{d}x} + \dfrac{1}{x}y = \dfrac{[value]}{x^2}.\] The coefficient in front of \(y\) is \(\dfrac{1}{x}\). So the integrating factor is \[e^{\int \frac{1}{x}\ \mathrm{d}x} = e^{\log(x)} = x.\] Multiply the standard form of the equation by the integrating factor to get \[ x\dfrac{\mathrm{d}y}{\mathrm{d}x} + y = \dfrac{[value]}{x}.\] Recognise that this is now exact and construct an integral \[\frac{\mathrm{d}}{\mathrm{d}x}(xy) = \dfrac{[value]}{x} \iff xy = \int \dfrac{[value]}{x}\ \mathrm{d}x.\] Integrating gives \[xy = [value] + C\] which implies \[y = \dfrac{[value]}{x}\log(x) + \dfrac{C}{x}\]

Exercise

Solve the equation

\[\frac{\mathrm{d}y}{\mathrm{d}t} + \cot t \cdot y = \sin t.\]

\(y = \) \(\displaystyle + \frac{C}{\sin t}\)
Feedback: This is a linear differential equation that is already in standard form. Note that here \(f(t) = \cot t\) and \(g(t) = \sin t\). \[\frac{\mathrm{d}y}{\mathrm{d}t} + \cot t \cdot y = \sin t.\] We use the key point to find the integrating factor: \[\begin{aligned} \text{I.F.} &= \exp \left[ \int \cot t \,\mathrm{d}t \right] \\ &= \exp \left[ \int \frac{\cos t}{\sin t} \,\mathrm{d}t \right] \\ &= \exp [ \ln (\sin t) ] \\ &= \sin t \end{aligned}\] Next we transform the equation into exact form by multiplying both sides with the integrating factor. It becomes: \[\sin t \cdot \frac{\mathrm{d}y}{\mathrm{d}t} + \cos t \cdot y = \sin^2 t\] Note that the left-hand side is the derivative of \(\sin t \cdot y\) with respect to \(t\). Our equation then becomes: \[\frac{\mathrm{d}}{\mathrm{d}t} \left( \sin t \cdot y \right) = \sin^2 t\] Therefore, we can find an expression for \(\sin t \cdot y\) by integrating the right-hand side. The result is: \[\begin{aligned} \sin t \cdot y &= \int \sin^2 t \,\mathrm{d}t \\ &= \int (1 - \cos^2 t) \,\mathrm{d}t \\ &= \int \left(1 - \frac{1 + \cos(2t)}{2}\right) \,\mathrm{d}t \\ &= \int \left(\frac{1}{2} - \frac{\cos(2t)}{2}\right) \,\mathrm{d}t \\ &= \frac{t}{2} - \frac{\sin(2t)}{4} + C \end{aligned}\] Which then gives the following general solution: \[y = \frac{t}{2\sin t} - \frac{\sin(2t)}{4\sin t} + \frac{C}{\sin t}\]

Exercise

Find the solution of the equation \(x\dfrac{\mathrm{d}y}{\mathrm{d}x} - y = [value]\) subject to the condition \(y(1) = [value]\).

\(y =\)
Feedback: We are given the equation \(x\dfrac{\mathrm{d}y}{\mathrm{d}x} - y = [value]\). Divide through by \(x\) to obtain the standard form of the equation \[\dfrac{\mathrm{d}y}{\mathrm{d}x} - \dfrac{y}{x} = [value].\] The coefficient in front of \(y\) is \(-\dfrac{1}{x}\). So the integrating factor is \[e^{\int -\frac{1}{x}\ \mathrm{d}x} = e^{-\log(x)} = \dfrac{1}{x}.\] Multiply the standard form of the equation by the integrating factor to get \[ \dfrac{1}{x} \dfrac{\mathrm{d}y}{\mathrm{d}x} - \dfrac{1}{x^2}y = \dfrac{[value]}{x}.\] Recognise that this is now exact and construct an integral \[\frac{\mathrm{d}}{\mathrm{d}x}\left(\frac{1}{x}y\right) = \dfrac{[value]}{x} \iff \frac{1}{x}y = \int \dfrac{[value]}{x}\ \mathrm{d}x.\] Integrating gives \[\frac{1}{x}y = [value] + C\] which implies \[y = [value]x\log(x) + Cx.\] We are given the condition \(y(1)=[value]\). Substituting \(x=1\) and \(y=[value]\) yields \(C=[value]\). Therefore we have \[ y = [value]\log(x) + [value]x.\]

Exercise

Find the general solution of the equation \(\dfrac{\mathrm{d}y}{\mathrm{d}t} + (\tan t)y = \cos t\).

\(y =\) \(+ C\cos t\).
Feedback: We are given the equation \(\dfrac{\mathrm{d}y}{\mathrm{d}t} + (\tan t)y = \cos t\). This equation is already in standard form. The coefficient in front of \(y\) is \(\tan t\). So the integrating factor is \[e^{\int \tan t \ \mathrm{d}t} = e^{\int \frac{\sin t}{\cos t} \ \mathrm{d}t} = e^{-\log(\cos t)} = -\frac{1}{\cos t}.\] Multiply the standard form of the equation by the integrating factor to get \[ \frac{1}{\cos t} \dfrac{\mathrm{d}y}{\mathrm{d}t} + \dfrac{\sin t}{\cos^2 t}y = 1.\] Recognise that this is now exact and construct an integral \[ \frac{\mathrm{d}}{\mathrm{d}t}\left( \frac{1}{\cos t}y \right) = 1 \iff \frac{1}{\cos t}y = \int 1 \ \mathrm{d}t.\] Integrating gives \[ \frac{1}{\cos t}y = t + C\] which implies \[ y = t\cos t + C\cos t.\]