Differential Equations

NCERT Class 12 Mathematics — Differential Equations, Exercise 9.5. All 19 questions solved.

A linear first-order differential equation has the form

$$\frac{dy}{dx} + \mathrm{P}y = \mathrm{Q}$$

where $\mathrm{P}$ and $\mathrm{Q}$ are functions of $x$ alone. It is solved by multiplying through by the integrating factor

$$\mathrm{I.F.} = e^{\int \mathrm{P}\,dx}$$

which turns the left-hand side into the derivative of a product, so that

$$y \cdot \mathrm{I.F.} = \int \mathrm{Q} \cdot \mathrm{I.F.}\;dx + \mathrm{C}$$

Key insight. Two things must be right before the formula can be used.

First, the coefficient of $\tfrac{dy}{dx}$ must be $1$. Questions 3, 6, 7 and 9 all begin with something else in front and must be divided through first — forgetting this is the single largest source of wrong integrating factors in the exercise.

Second, check which variable is dependent. In questions 10, 11 and 12 the equation is not linear in $y$ but is linear in $x$, so write it as $\tfrac{dx}{dy} + \mathrm{P}_1x = \mathrm{Q}_1$ and integrate with respect to $y$. Trying to force those three into the standard form leads nowhere.

For each of the differential equations given in Exercises 1 to 12, find the general solution.

Question 1

$\dfrac{dy}{dx} + 2y = \sin x$

Solution. $\mathrm{P} = 2$, so $\mathrm{I.F.} = e^{\int 2\,dx} = e^{2x}$:

$$y\,e^{2x} = \int e^{2x}\sin x\,dx$$

The integral is the standard $\int e^{ax}\sin bx\,dx = \dfrac{e^{ax}(a\sin bx – b\cos bx)}{a^2+b^2}$, here with $a = 2$, $b = 1$:

$$y\,e^{2x} = \frac{e^{2x}(2\sin x – \cos x)}{5} + \mathrm{C}$$

$$y = \frac15\left(2\sin x – \cos x\right) + \mathrm{C}e^{-2x}$$

Question 2

$\dfrac{dy}{dx} + 3y = e^{-2x}$

Solution. $\mathrm{I.F.} = e^{3x}$:

$$y\,e^{3x} = \int e^{3x}e^{-2x}dx = \int e^x dx = e^x + \mathrm{C}$$

$$y = e^{-2x} + \mathrm{C}e^{-3x}$$

Question 3

$\dfrac{dy}{dx} + \dfrac{y}{x} = x^2$

Solution. $\mathrm{P} = \tfrac1x$, so $\mathrm{I.F.} = e^{\log x} = x$:

$$xy = \int x \cdot x^2\,dx = \frac{x^4}{4} + \mathrm{C}$$

$$xy = \frac{x^4}{4} + \mathrm{C}$$

Question 4

$\dfrac{dy}{dx} + (\sec x)y = \tan x$  $\left(0 \le x < \tfrac{\pi}{2}\right)$

Solution. $\int\sec x\,dx = \log|\sec x + \tan x|$, so

$$\mathrm{I.F.} = e^{\log|\sec x + \tan x|} = \sec x + \tan x$$

$$y(\sec x + \tan x) = \int\tan x(\sec x + \tan x)\,dx = \int\left(\sec x\tan x + \sec^2x – 1\right)dx$$

using $\tan^2x = \sec^2x – 1$:

$$y(\sec x + \tan x) = \sec x + \tan x – x + \mathrm{C}$$

Question 5

$\cos^2x\dfrac{dy}{dx} + y = \tan x$  $\left(0 \le x < \tfrac{\pi}{2}\right)$

Solution. Divide by $\cos^2x$ to make the leading coefficient $1$:

$$\frac{dy}{dx} + \sec^2x\,y = \sec^2x\tan x$$

$$\mathrm{I.F.} = e^{\int\sec^2x\,dx} = e^{\tan x}$$

$$y\,e^{\tan x} = \int e^{\tan x}\sec^2x\tan x\,dx$$

Put $t = \tan x$, so $dt = \sec^2x\,dx$, and the integral becomes $\int t\,e^t\,dt = e^t(t-1)$:

$$y = (\tan x – 1) + \mathrm{C}e^{-\tan x}$$

Question 6

$x\dfrac{dy}{dx} + 2y = x^2\log x$

Solution. Divide by $x$: $\dfrac{dy}{dx} + \dfrac{2}{x}y = x\log x$, so $\mathrm{I.F.} = e^{2\log x} = x^2$:

$$x^2y = \int x^3\log x\,dx$$

Integrating by parts with $\log x$ as the first function:

$$= \frac{x^4}{4}\log x – \int\frac{x^3}{4}dx = \frac{x^4}{4}\log x – \frac{x^4}{16}$$

$$y = \frac{x^2}{16}\left(4\log|x| – 1\right) + \mathrm{C}x^{-2}$$

Question 7

$x\log x\dfrac{dy}{dx} + y = \dfrac{2}{x}\log x$

Solution. Divide by $x\log x$:

$$\frac{dy}{dx} + \frac{1}{x\log x}y = \frac{2}{x^2}$$

For the integrating factor, $\int\tfrac{dx}{x\log x} = \log|\log x|$, so $\mathrm{I.F.} = \log x$:

$$y\log x = \int\frac{2\log x}{x^2}dx$$

By parts with $\log x$ first:

$$= -\frac{2\log x}{x} + \int\frac{2}{x^2}dx = -\frac{2\log x}{x} – \frac2x$$

$$y\log x = \frac{-2}{x}\left(1 + \log|x|\right) + \mathrm{C}$$

Question 8

$\left(1 + x^2\right)dy + 2xy\,dx = \cot x\,dx$  $(x \ne 0)$

Solution. Divide by $\left(1+x^2\right)$:

$$\frac{dy}{dx} + \frac{2x}{1+x^2}y = \frac{\cot x}{1+x^2}$$

$$\mathrm{I.F.} = e^{\log\left(1+x^2\right)} = 1 + x^2$$

$$y\left(1+x^2\right) = \int\cot x\,dx = \log|\sin x| + \mathrm{C}$$

Notice that the left-hand side of the original equation was already $\tfrac{d}{dx}\left[y\left(1+x^2\right)\right]$ — the integrating factor was $1$ in disguise.

$$y = (1+x^2)^{-1}\log|\sin x| + \mathrm{C}\left(1+x^2\right)^{-1}$$

Question 9

$x\dfrac{dy}{dx} + y – x + xy\cot x = 0$  $(x \ne 0)$

Solution. Divide by $x$ and collect the $y$ terms:

$$\frac{dy}{dx} + \left(\frac1x + \cot x\right)y = 1$$

$$\int\left(\frac1x + \cot x\right)dx = \log|x| + \log|\sin x| = \log|x\sin x|$$

so $\mathrm{I.F.} = x\sin x$:

$$y\,x\sin x = \int x\sin x\,dx = -x\cos x + \sin x + \mathrm{C}$$

Dividing through:

$$y = \frac1x – \cot x + \frac{\mathrm{C}}{x\sin x}$$

Question 10

$(x + y)\dfrac{dy}{dx} = 1$

Solution. This is not linear in $y$. Invert it:

$$\frac{dx}{dy} = x + y \quad\Longrightarrow\quad \frac{dx}{dy} – x = y$$

Now it is linear in $x$, with $\mathrm{P}_1 = -1$ and $\mathrm{I.F.} = e^{-y}$:

$$x\,e^{-y} = \int y\,e^{-y}dy = -e^{-y}(y+1) + \mathrm{C}$$

$$x = -(y+1) + \mathrm{C}e^{y}$$

$$(x + y + 1) = \mathrm{C}e^{y}$$

Question 11

$y\,dx + \left(x – y^2\right)dy = 0$

Solution. Treating $x$ as the dependent variable:

$$\frac{dx}{dy} + \frac{x}{y} = y$$

$\mathrm{I.F.} = e^{\log y} = y$:

$$xy = \int y^2\,dy = \frac{y^3}{3} + \mathrm{C}$$

$$x = \frac{y^2}{3} + \frac{\mathrm{C}}{y}$$

Question 12

$\left(x + 3y^2\right)\dfrac{dy}{dx} = y$  $(y > 0)$

Solution. Again invert and treat $x$ as dependent:

$$\frac{dx}{dy} = \frac{x + 3y^2}{y} \quad\Longrightarrow\quad \frac{dx}{dy} – \frac{x}{y} = 3y$$

$\mathrm{I.F.} = e^{-\log y} = \tfrac1y$:

$$\frac{x}{y} = \int\frac{3y}{y}dy = 3y + \mathrm{C}$$

$$x = 3y^2 + \mathrm{C}y$$

For each of the differential equations given in Exercises 13 to 15, find a particular solution satisfying the given condition.

Question 13

$\dfrac{dy}{dx} + 2y\tan x = \sin x$; $y = 0$ when $x = \dfrac{\pi}{3}$

Solution. $\int 2\tan x\,dx = 2\log|\sec x| = \log\sec^2x$, so $\mathrm{I.F.} = \sec^2x$:

$$y\sec^2x = \int\sec^2x\sin x\,dx = \int\sec x\tan x\,dx = \sec x + \mathrm{C}$$

$$y = \cos x + \mathrm{C}\cos^2x$$

At $x = \tfrac{\pi}{3}$, $y = 0$: $0 = \tfrac12 + \tfrac{\mathrm{C}}{4}$, so $\mathrm{C} = -2$.

$$y = \cos x – 2\cos^2x$$

Question 14

$\left(1 + x^2\right)\dfrac{dy}{dx} + 2xy = \dfrac{1}{1+x^2}$; $y = 0$ when $x = 1$

Solution. As in question 8, the left side is already $\tfrac{d}{dx}\left[y\left(1+x^2\right)\right]$, so

$$y\left(1+x^2\right) = \int\frac{dx}{1+x^2} = \tan^{-1}x + \mathrm{C}$$

At $x = 1$, $y = 0$: $0 = \tfrac{\pi}{4} + \mathrm{C}$, so $\mathrm{C} = -\tfrac{\pi}{4}$.

$$y\left(1+x^2\right) = \tan^{-1}x – \frac{\pi}{4}$$

Question 15

$\dfrac{dy}{dx} – 3y\cot x = \sin 2x$; $y = 2$ when $x = \dfrac{\pi}{2}$

Solution. $\int -3\cot x\,dx = -3\log|\sin x|$, so $\mathrm{I.F.} = \sin^{-3}x$:

$$\frac{y}{\sin^3x} = \int\frac{\sin 2x}{\sin^3x}dx = \int\frac{2\sin x\cos x}{\sin^3x}dx = 2\int\frac{\cos x}{\sin^2x}dx = -\frac{2}{\sin x} + \mathrm{C}$$

$$y = -2\sin^2x + \mathrm{C}\sin^3x$$

At $x = \tfrac{\pi}{2}$, $y = 2$: $2 = -2 + \mathrm{C}$, so $\mathrm{C} = 4$.

$$y = 4\sin^3x – 2\sin^2x$$

Question 16

Find the equation of a curve passing through the origin given that the slope of the tangent to the curve at any point $(x, y)$ is equal to the sum of the coordinates of the point.

Solution. The condition is $\dfrac{dy}{dx} = x + y$, that is $\dfrac{dy}{dx} – y = x$. With $\mathrm{I.F.} = e^{-x}$:

$$y\,e^{-x} = \int x\,e^{-x}dx = -e^{-x}(x+1) + \mathrm{C}$$

$$y = -(x+1) + \mathrm{C}e^{x}$$

Through the origin: $0 = -1 + \mathrm{C}$, so $\mathrm{C} = 1$.

$$x + y + 1 = e^{x}$$

Question 17

Find the equation of a curve passing through the point $(0, 2)$ given that the sum of the coordinates of any point on the curve exceeds the magnitude of the slope of the tangent to the curve at that point by $5$.

Solution. “The sum of the coordinates exceeds the slope by $5$” means

$$x + y = \frac{dy}{dx} + 5 \quad\Longrightarrow\quad \frac{dy}{dx} – y = x – 5$$

$\mathrm{I.F.} = e^{-x}$:

$$y\,e^{-x} = \int(x-5)e^{-x}dx = -e^{-x}(x – 4) + \mathrm{C}$$

$$y = -(x – 4) + \mathrm{C}e^{x} = 4 – x + \mathrm{C}e^x$$

At $(0, 2)$: $2 = 4 + \mathrm{C}$, so $\mathrm{C} = -2$.

$$y = 4 – x – 2e^{x}$$

Question 18

The Integrating Factor of the differential equation $x\dfrac{dy}{dx} – y = 2x^2$ is

(A) $e^{-x}$
(B) $e^{-y}$
(C) $\frac{1}{x}$
(D) $x$

Solution. Divide by $x$ first — this is the whole question:

$$\frac{dy}{dx} – \frac{y}{x} = 2x$$

So $\mathrm{P} = -\tfrac1x$ and

$$\mathrm{I.F.} = e^{-\int\frac{dx}{x}} = e^{-\log x} = \frac1x$$

Option (D) is what you get by reading the coefficient of $\tfrac{dy}{dx}$ as $\mathrm{P}$ without dividing first.

$$\text{(C)}\quad \frac{1}{x}$$

Question 19

The Integrating Factor of the differential equation $\left(1 – y^2\right)\dfrac{dx}{dy} + yx = ay$  $(-1 < y < 1)$ is

(A) $\frac{1}{y^2-1}$
(B) $\frac{1}{\sqrt{y^2-1}}$
(C) $\frac{1}{1-y^2}$
(D) $\frac{1}{\sqrt{1-y^2}}$

Solution. This one is linear in $x$. Divide by $\left(1-y^2\right)$:

$$\frac{dx}{dy} + \frac{y}{1-y^2}x = \frac{ay}{1-y^2}$$

$$\int\frac{y\,dy}{1-y^2} = -\frac12\log\left(1-y^2\right)$$

$$\mathrm{I.F.} = e^{-\frac12\log\left(1-y^2\right)} = \left(1-y^2\right)^{-1/2}$$

The restriction $-1 < y < 1$ is what keeps $1 – y^2$ positive, which is why the answer has $1 – y^2$ under the root and not $y^2 – 1$.

$$\text{(D)}\quad \frac{1}{\sqrt{1-y^2}}$$

Common mistakes

  • Not dividing to make the leading coefficient $1$. Questions 5, 6, 7, 8, 9, 18 and 19 all need it, and question 18 exists purely to catch it.
  • Trying to force a $\tfrac{dx}{dy}$ equation into $\tfrac{dy}{dx}$ form. Questions 10, 11, 12 and 19 are linear only in $x$.
  • Getting the sign wrong in $e^{\int \mathrm{P}\,dx}$. In question 18, $\mathrm{P} = -\tfrac1x$, so the integrating factor is $\tfrac1x$, not $x$.
  • Forgetting that $e^{\log f} = f$. Simplify the integrating factor before integrating — carrying $e^{2\log x}$ instead of $x^2$ makes the next integral much harder to see.
  • Applying the initial condition before dividing by the integrating factor. Substitute into the fully simplified solution, not the intermediate form.
  • Losing a constant when both sides are multiplied out. The $+\,\mathrm{C}$ is added after integrating the right-hand side, so it too gets divided by the integrating factor.

Practise next

Keep track of what you have finished — create a free account.

Doubts are answered by Shiwam, usually within a day. Ask about this question specifically — a general question about the chapter is better asked in class.

Ask your doubt

Stuck on this question? Ask Shiwam directly.

A free account lets you post a doubt on any question, keep track of the exercises you have finished, and come back to the answer later.

Create a free accountI already have one