girgit.org

Differential Equations

Linear equations in action, and which method to use

The big ideaThe integrating factor also works with x and y swapped, \( \frac{dx}{dy} + P_1x = Q_1 \); together with a quick check of which method fits, it solves every first order equation in this chapter.

In simple words

Sometimes an equation looks impossible because you are holding it the wrong way round. Turn it over, so that you ask how x changes with y instead of how y changes with x, and it becomes the easy kind. And before starting any equation, take a few seconds to ask which of your three tools fits. Picking the right tool is half the work.

The other way round: x as the unknown

A linear equation can also have x as the dependent variable:

\[ \frac{dx}{dy} + P_1x = Q_1, \]

where \( P_1 \) and \( Q_1 \) are constants or functions of y only. Everything is the same with the letters swapped:

Linear in x

  • I.F. \( = e^{\int P_1\,dy} \)
  • Solution: \( x \cdot \text{I.F.} = \int Q_1 \cdot \text{I.F.}\,dy + C \)

Guess first: is this a dead end?

Look at \( y\,dx - (x + y^2e^y)\,dy = 0 \). Written as \( \frac{dy}{dx} = \frac{y}{x + y^2e^y} \), it is not separable, not homogeneous, and not linear in y. Guess: can any method in this chapter solve it?

See what happens
Yes: turn it over. \( \frac{dx}{dy} = \frac{x + y^2e^y}{y} \), that is \( \frac{dx}{dy} - \frac{1}{y}x = ye^y \). This is linear in x with \( P_1 = -\frac{1}{y} \), \( Q_1 = ye^y \). I.F. \( = e^{-\log y} = \frac{1}{y} \) (y > 0). Then \( \frac{x}{y} = \int ye^y \cdot \frac{1}{y}\,dy + C = e^y + C \), so \( x = ye^y + Cy \). When y appears in an awkward way but x only to the first power, try \( \frac{dx}{dy} \).

Worked example: a particular solution

Solve \( \frac{dy}{dx} + y\tan x = \cos x \), given y = 1 when x = 0.

  1. P = tan x, Q = cos x. I.F. \( = e^{\int\tan x\,dx} = e^{\log\sec x} = \sec x \).
  2. \( y\sec x = \int \cos x\sec x\,dx + C = \int 1\,dx + C = x + C \).
  3. So \( y = (x + C)\cos x \). At x = 0, y = 1: \( 1 = C \).
  4. Particular solution: \( y = (x + 1)\cos x \).

Worked example: a curve from its slope

A curve passes through (0, 1), and at every point (x, y) its slope is 2x − y. Find it.

  1. \( \frac{dy}{dx} = 2x - y \), so \( \frac{dy}{dx} + y = 2x \). Linear, P = 1, Q = 2x, I.F. \( = e^x \).
  2. \( ye^x = \int 2xe^x\,dx + C \). By parts: \( \int 2xe^x\,dx = 2xe^x - 2e^x \).
  3. So \( ye^x = 2(x - 1)e^x + C \), that is \( y = 2x - 2 + Ce^{-x} \).
  4. Through (0, 1): \( 1 = -2 + C \), C = 3. The curve is \( y = 2x - 2 + 3e^{-x} \).

Try it: every curve with slope 2x − y at each point. Start P at (0, 1) and you get the worked example; start it anywhere else and watch where the curve heads.

Which method?

Ask these questions in this order. Some equations fit more than one; then use whichever is quickest.

AskIf yesExample
Can \( \frac{dy}{dx} \) be written as g(x) h(y)?Separate the variables\( \frac{dy}{dx} = e^{x}\cos^2 y \)
Is \( \frac{dy}{dx} \) a function of \( \frac{y}{x} \) only (degree 0)?Put y = vx\( \frac{dy}{dx} = \frac{x - y}{x + y} \)
Is it \( \frac{dy}{dx} + Py = Q \), P and Q in x only?I.F. \( e^{\int P\,dx} \)\( \frac{dy}{dx} + \frac{y}{x} = x^2 \)
Is it \( \frac{dx}{dy} + P_1x = Q_1 \), in y only?I.F. \( e^{\int P_1\,dy} \)\( \frac{dx}{dy} - \frac{x}{y} = ye^y \)
Does x + y (or ax + by) keep appearing together?Put v = x + y\( \frac{dy}{dx} = (x + y)^2 \)

An equation such as \( \frac{dy}{dx} + 2y = 4 \) is both separable (\( \frac{dy}{4 - 2y} = dx \)) and linear (I.F. \( e^{2x} \)). Both give \( y = 2 + Ce^{-2x} \).

Practise: pick the tool before you start.

A substitution trick

The book's last exercises hint at this: when x and y always come as a block like x + y, name the block. For \( \frac{dy}{dx} = (x + y)^2 \), put v = x + y. Then \( \frac{dv}{dx} = 1 + \frac{dy}{dx} = 1 + v^2 \). Separate: \( \frac{dv}{1 + v^2} = dx \), so \( \tan^{-1}v = x + C \), and \( y = \tan(x + C) - x \).

Not in the current textbook, but JEE asks it: a Bernoulli equation \( \frac{dy}{dx} + Py = Qy^n \) (n ≠ 0, 1) becomes linear with \( z = y^{1-n} \). For \( \frac{dy}{dx} + y = xy^2 \), divide by \( y^2 \) and put \( z = \frac{1}{y} \), so \( \frac{dz}{dx} = -\frac{1}{y^2}\frac{dy}{dx} \): the equation becomes \( \frac{dz}{dx} - z = -x \). I.F. \( e^{-x} \) gives \( z = x + 1 + Ce^x \), so \( y = \frac{1}{x + 1 + Ce^x} \).

Try it. Find the curve through (0, 3) whose slope at every point (x, y) is y − x.

Answer
\( \frac{dy}{dx} - y = -x \). I.F. \( e^{-x} \): \( ye^{-x} = \int -xe^{-x}\,dx = (x + 1)e^{-x} + C \), so \( y = x + 1 + Ce^x \). Through (0, 3): C = 2. The curve is \( y = x + 1 + 2e^x \). (Through (0, 1) instead, C = 0 and the "curve" is the straight line y = x + 1.)

Words to know

Linear in x
\( \frac{dx}{dy} + P_1x = Q_1 \), with \( P_1, Q_1 \) depending on y only.
\( e^{\int P_1\,dy} \)
The integrating factor when x is the unknown.
Substitution
Giving a repeated block (like x + y) a new name to simplify the equation.
Bernoulli equation
\( \frac{dy}{dx} + Py = Qy^n \); made linear by \( z = y^{1-n} \) (JEE).

What is the integrating factor of \( \frac{dx}{dy} + \frac{2}{y}x = y^2 \)?

  1. \( y^2 \)
  2. \( x^2 \)
  3. \( \frac{1}{y^2} \)

Which method fits \( \frac{dy}{dx} = \frac{x^2 + 3y^2}{2xy} \) best?

  1. Variables separable
  2. Homogeneous, y = vx
  3. Linear, I.F. \( e^{\int P\,dx} \)

The general solution of \( \frac{dy}{dx} + y\cot x = 2\cos x \) is

  1. \( y = \sin x + C \)
  2. \( y = \sin x + C\operatorname{cosec} x \)
  3. \( y = \cos x + C\sec x \)