Class 12 Maths, Worked in Full Past papersGet updates
Chapter 9 · Differential Equations

Exercise 9.3 · Q3: General solution of dydx+y=1\frac{dy}{dx} + y = 1⁠, y≠1y \ne 1

Exercise 9.3Variables separable · Section 9.4.1
The question

For each of the differential equations in Exercises 1 to 10, find the general solution:

3. dydx+y=1\dfrac{dy}{dx} + y = 1  (y≠1)(y \ne 1)

Exam answer

We have dydx=1−y\frac{dy}{dx} = 1 - y⁠. Since y≠1y \ne 1⁠, separating the variables,

dy1−y=dx\frac{dy}{1 - y} = dx

Integrating both sides,

∫dy1−y=∫dx−log⁡∣1−y∣=x+C1∣1−y∣=e−C1e−x1−y=±e−C1e−x\begin{aligned} \int\frac{dy}{1 - y} &= \int dx \\ -\log|1 - y| &= x + C_1 \\ |1 - y| &= e^{-C_1}e^{-x} \\ 1 - y &= \pm e^{-C_1}e^{-x} \end{aligned}

Writing A=∓e−C1A = \mp e^{-C_1}⁠, a nonzero constant,

∴\therefore y=1+Ae−xy = 1 + Ae^{-x} is the general solution.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Moving yy to the right gives dydx=1−y\frac{dy}{dx} = 1 - y⁠: the slope depends on yy only, so the equation is separable. The condition y≠1y \ne 1 is exactly what lets us divide by 1−y1 - y⁠. Integrating gives a logarithm; removing the logarithm and the modulus turns the constant into a multiplier AA of e−xe^{-x}⁠.

Given, to find, and the plan
Given
dydx+y=1\frac{dy}{dx} + y = 1⁠, with y≠1y \ne 1⁠.
To find
The general solution, with one arbitrary constant.
Plan
(1) Rewrite as dydx=1−y\frac{dy}{dx} = 1 - y and recognise the separable form. (2) Separate, dividing by 1−y≠01 - y \ne 0⁠. (3) Integrate, with one constant. (4) Remove the log and the modulus to get yy⁠. (5) Check by substituting back, and draw the family.

Basics you need

1Variables separable

If dydx=g(x) h(y)\frac{dy}{dx} = g(x)\,h(y) with h(y)≠0h(y) \ne 0⁠, then ∫dyh(y)=∫g(x) dx\int\frac{dy}{h(y)} = \int g(x)\,dx (Section 9.4.1). Lesson: separate, then integrate

2The log integral

∫dtt=log⁡∣t∣+C\int\frac{dt}{t} = \log|t| + C (Section 7.2, formula (xii)); with t=1−yt = 1 - y⁠, dt=−dydt = -dy⁠, so ∫dy1−y=−log⁡∣1−y∣+C\int\frac{dy}{1 - y} = -\log|1 - y| + C⁠. Basics: every method ends with an integral

3Undoing a logarithm

log⁡∣u∣=k\log|u| = k means ∣u∣=ek|u| = e^k⁠, so u=eku = e^k or u=−eku = -e^k⁠. Basics: the exponential function

4One arbitrary constant

A first order equation has one arbitrary constant in its general solution. Basics: order n gives n constants

Solution

  1. Rewrite and recognise the form: variables separable

    Subtract yy from both sides:

    dydx=1−y=g(x) h(y),g(x)=1,h(y)=1−y.\begin{aligned} \frac{dy}{dx} &= 1 - y = g(x)\,h(y), \\ g(x) &= 1,\quad h(y) = 1 - y. \end{aligned}

    The question says y≠1y \ne 1⁠, so h(y)=1−y≠0h(y) = 1 - y \ne 0⁠.

    The book's method needs the form g(x) h(y)g(x)\,h(y) with h(y)≠0h(y) \ne 0⁠. The only zero of 1−y1 - y is y=1y = 1⁠, which the question excludes. (The constant function y=1y = 1 does satisfy the equation, 0+1=10 + 1 = 1⁠; that is why the question sets it aside.)
    Section 9.4.1: separation needs h(y)≠0h(y) \ne 0⁠. Lesson: separate, then integrate
  2. Separate the variables

    Divide both sides by 1−y1 - y (nonzero) and multiply by dxdx⁠:

    dy1−y=dx.\frac{dy}{1 - y} = dx.
    Each side now holds one variable only, so each can be integrated on its own.
    Separating: yy with dydy⁠, xx with dxdx⁠. Basics: dy = y′ dx
  3. Integrate both sides, with one constant

    ∫dy1−y=∫dx⇒ −log⁡∣1−y∣=x+C1.\begin{aligned} \int\frac{dy}{1 - y} &= \int dx \\ \Rightarrow\ -\log|1 - y| &= x + C_1. \end{aligned}

    Check each integral by differentiating: ddx(x)=1\frac{d}{dx}(x) = 1⁠, and by the chain rule

    ddy(−log⁡∣1−y∣)=−11−y⋅(−1)=11−y.\begin{aligned} &\frac{d}{dy}\left(-\log|1 - y|\right) \\ &= -\frac{1}{1 - y}\cdot(-1) = \frac{1}{1 - y}. \end{aligned}
    Put t=1−yt = 1 - y⁠: then dt=−dydt = -dy and ∫dy1−y=−∫dtt=−log⁡∣t∣\int\frac{dy}{1 - y} = -\int\frac{dt}{t} = -\log|t|⁠. The minus sign comes from the −y-y inside. The two constants of integration combine into one, C1C_1⁠.
    Section 7.2, formula (xii), with a substitution (Section 7.3.1). Basics: every method ends with an integral
  4. Remove the log and the modulus: solve for yy

    Multiply by −1-1 and take the exponential:

    log⁡∣1−y∣=−x−C1,∣1−y∣=e−C1e−x,1−y=±e−C1e−x.\begin{aligned} \log|1 - y| &= -x - C_1, \\ |1 - y| &= e^{-C_1}e^{-x}, \\ 1 - y &= \pm e^{-C_1}e^{-x}. \end{aligned}

    Put A=∓e−C1A = \mp e^{-C_1} (the opposite sign, because of y=1−(1−y)y = 1 - (1 - y)⁠):

    y=1+Ae−x.y = 1 + Ae^{-x}.
    e−C1e^{-C_1} is any positive number, and the sign ±\pm is fixed along a solution, because 1−y1 - y is continuous and never 0, so it cannot change sign. Together AA runs over every nonzero real number. A=0A = 0 would give y=1y = 1⁠, the case the question excludes.
    ea+b=eaebe^{a + b} = e^a e^b and elog⁡t=te^{\log t} = t⁠. Basics: the exponential function
  5. Check: substitute back, and see the family

    For y=1+Ae−xy = 1 + Ae^{-x}⁠, dydx=−Ae−x\frac{dy}{dx} = -Ae^{-x}⁠, so

    dydx+y=−Ae−x+1+Ae−x=1.\frac{dy}{dx} + y = -Ae^{-x} + 1 + Ae^{-x} = 1.

    L.H.S. = R.H.S. for every AA and every real xx⁠, and y≠1y \ne 1 because Ae−x≠0Ae^{-x} \ne 0⁠.

    X Y O y = 1 A = 2 A = 1/2 A = −1/2 A = −2
    Members of y=1+Ae−xy = 1 + Ae^{-x}⁠, drawn with equal scales on the slope field of dydx=1−y\frac{dy}{dx} = 1 - y⁠, for A=2A = 2 and A=12A = \frac{1}{2} (above the line) and A=−12A = -\frac{1}{2} and A=−2A = -2 (below). The dashed line y=1y = 1 is excluded by the question; every curve approaches it as xx grows and none crosses it.
    Substituting back is the definition of a solution (Section 9.3). The picture shows why the sign of 1−y1 - y never changes: a curve above y=1y = 1 has negative slope and sinks towards the line, one below rises towards it, and neither can reach it.
Result

The general solution is y=1+Ae−xy = 1 + Ae^{-x}⁠, where AA is an arbitrary nonzero constant, valid for every real xx⁠. (Textbook answer: y=1+Ae−xy = 1 + Ae^{-x}⁠.)

Check it with numbers

Take A=2A = 2⁠, the curve y=1+2e−xy = 1 + 2e^{-x}⁠. At x=1x = 1⁠, y≈1.7357588823y \approx 1.7357588823⁠, and the equation gives the slope 1−y≈−0.735758881 - y \approx -0.73575888⁠.

The curve itself: y(1.001)≈1.7350234912y(1.001) \approx 1.7350234912 and y(0.999)≈1.7364950092y(0.999) \approx 1.7364950092⁠, so

1.7350234912−1.73649500920.002≈−0.73576.\begin{aligned} &\frac{1.7350234912 - 1.7364950092}{0.002} \\ &\approx -0.73576. \end{aligned}
Common mistakes
  1. ∫dy1−y=log⁡∣1−y∣\int\frac{dy}{1 - y} = \log|1 - y|⁠. The derivative of 1−y1 - y is −1-1⁠, so the integral is −log⁡∣1−y∣-\log|1 - y|⁠.
  2. e−x−C1=e−x−eC1e^{-x - C_1} = e^{-x} - e^{C_1}⁠. Exponents add when powers multiply: e−x−C1=e−C1e−xe^{-x - C_1} = e^{-C_1}e^{-x}⁠.
  3. Dropping the modulus and keeping only 1−y>01 - y > 0⁠. The ±\pm gives the curves below y=1y = 1 as well.
What to take away
  1. Rearrange first: dydx+y=1\frac{dy}{dx} + y = 1 is dydx=1−y\frac{dy}{dx} = 1 - y⁠, separable.
  2. A log constant becomes a multiplying constant: log⁡∣u∣=−x−C1\log|u| = -x - C_1 gives u=Ae−xu = Ae^{-x}⁠.
  3. The excluded value y=1y = 1 is the one curve the division would have lost.

Every fact used, and where it comes from

FactUsed inSource
Variables separable; divide by h(y)≠0h(y) \ne 0 and integrateSteps 1, 2Section 9.4.1 (Lesson)
∫dtt=log⁡∣t∣+C\int\frac{dt}{t} = \log|t| + C⁠; substitution t=1−yt = 1 - yStep 3Section 7.2, formula (xii); Section 7.3.1 (Basics)
One arbitrary constant for a first order equationSteps 3, 4Section 9.3 (Basics)
ea+b=eaebe^{a + b} = e^ae^b⁠; ∣u∣=c|u| = c means u=±cu = \pm cStep 4Exponential and modulus (Basics)
A solution makes L.H.S. = R.H.S.; solution curves follow the slope fieldStep 5Section 9.3 (Basics)
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →