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

Example 4: General solution of dydx=x+12−y\frac{dy}{dx} = \frac{x+1}{2-y}

ExamplesVariables separable · Section 9.4.1
The question

Find the general solution of the differential equation dydx=x+12−y\dfrac{dy}{dx} = \dfrac{x + 1}{2 - y}⁠, (y≠2)(y \ne 2)

Exam answer

We have

dydx=x+12−y,y≠2\frac{dy}{dx} = \frac{x + 1}{2 - y},\quad y \ne 2

Separating the variables,

(2−y) dy=(x+1) dx(2 - y)\,dy = (x + 1)\,dx

Integrating both sides,

∫(2−y) dy=∫(x+1) dx2y−y22=x22+x+C1\begin{aligned} \int(2 - y)\,dy &= \int(x + 1)\,dx \\ 2y - \frac{y^2}{2} &= \frac{x^2}{2} + x + C_1 \end{aligned}

Multiplying by −2-2 and rearranging,

x2+y2+2x−4y+2C1=0x^2 + y^2 + 2x - 4y + 2C_1 = 0

∴\therefore x2+y2+2x−4y+C=0x^2 + y^2 + 2x - 4y + C = 0⁠, where C=2C1C = 2C_1⁠, is the general solution.

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

The one idea this problem is built on

The right side is a function of xx times a function of yy⁠: x+12−y=(x+1)⋅12−y\frac{x + 1}{2 - y} = (x + 1)\cdot\frac{1}{2 - y}⁠. So the variables can be separated: every yy goes with dydy⁠, every xx with dxdx⁠. Then each side is an ordinary integral, and one arbitrary constant appears. The answer is a family of circles.

Given, to find, and the plan
Given
dydx=x+12−y\frac{dy}{dx} = \frac{x + 1}{2 - y}⁠, with y≠2y \ne 2 (the right side is undefined at y=2y = 2⁠).
To find
The general solution: a relation between xx and yy with one arbitrary constant.
Plan
(1) Recognise the variables separable form. (2) Separate. (3) Integrate both sides, with one constant. (4) Tidy up and rename the constant. (5) Check by differentiating the answer back. (6) Picture the solution curves.

Basics you need

1Variables separable

If dydx=g(x) h(y)\frac{dy}{dx} = g(x)\,h(y) and h(y)≠0h(y) \ne 0⁠, then 1h(y) dy=g(x) dx\frac{1}{h(y)}\,dy = g(x)\,dx⁠, and integrating gives H(y)=G(x)+CH(y) = G(x) + C (Section 9.4.1, equations (2) to (4)). Lesson: separate, then integrate

2Treating dydy and dxdx as separate pieces

Writing (2−y) dy=(x+1) dx(2 - y)\,dy = (x + 1)\,dx is shorthand for "(2−y)dydx=x+1(2 - y)\frac{dy}{dx} = x + 1"; integrating that with respect to xx turns the left side into ∫(2−y) dy\int(2 - y)\,dy (substitution). Basics: dy = y′ dx

3Power rule for integrals

∫tn dt=tn+1n+1+C\int t^n\,dt = \frac{t^{n+1}}{n + 1} + C for n≠−1n \ne -1 (Section 7.2, formula (i)). Basics: every method ends with an integral

4One arbitrary constant

A first order equation has one arbitrary constant in its general solution. Constants on both sides combine into one, and any fixed multiple of an arbitrary constant is again arbitrary. Basics: order n gives n constants

Solution

  1. Recognise the form: variables separable

    dydx=x+12−y=(x+1)⋅12−y=g(x) h(y),\begin{aligned} \frac{dy}{dx} &= \frac{x + 1}{2 - y} = (x + 1)\cdot\frac{1}{2 - y} \\ &= g(x)\,h(y), \end{aligned}

    with g(x)=x+1g(x) = x + 1 and h(y)=12−yh(y) = \frac{1}{2 - y}⁠. Since y≠2y \ne 2⁠, h(y)h(y) is defined and is never 0.

    The method of Section 9.4.1 needs the right side to split as (a function of xx only) ×\times (a function of yy only), and needs h(y)≠0h(y) \ne 0 so that we may divide by it. Both hold here.
    Section 9.4.1: dydx=h(y) g(x)\frac{dy}{dx} = h(y)\,g(x) is the variables separable type. Lesson: separate, then integrate
  2. Separate the variables

    Multiply both sides by (2−y) dx(2 - y)\,dx⁠:

    (2−y) dy=(x+1) dx.(2 - y)\,dy = (x + 1)\,dx.
    Now the left side contains only yy (with dydy⁠) and the right side only xx (with dxdx⁠). Multiplying by 2−y2 - y is allowed because 2−y≠02 - y \ne 0⁠. In the language of Section 9.4.1 this is 1h(y) dy=g(x) dx\frac{1}{h(y)}\,dy = g(x)\,dx with 1h(y)=2−y\frac{1}{h(y)} = 2 - y⁠.
    Separating: yy with dydy⁠, xx with dxdx⁠. Basics: dy = y′ dx
  3. Integrate both sides, with one constant

    ∫(2−y) dy=∫(x+1) dx\int(2 - y)\,dy = \int(x + 1)\,dx 2y−y22=x22+x+C1.2y - \frac{y^2}{2} = \frac{x^2}{2} + x + C_1.

    Check each integral by differentiating: ddy(2y−y22)=2−y\frac{d}{dy}\left(2y - \frac{y^2}{2}\right) = 2 - y and ddx(x22+x)=x+1\frac{d}{dx}\left(\frac{x^2}{2} + x\right) = x + 1⁠.

    Each side is integrated with respect to its own variable by the power rule. Each integration produces a constant, but two constants k1k_1⁠, k2k_2 on opposite sides combine into a single one, C1=k2−k1C_1 = k_2 - k_1⁠. A first order equation needs exactly one arbitrary constant.
    Power rule, Section 7.2; one constant for order 1. Basics: order n gives n constants
  4. Tidy up and rename the constant

    Multiply both sides by −2-2⁠:

    −4y+y2=−x2−2x−2C1.-4y + y^2 = -x^2 - 2x - 2C_1.

    Move every term to the left:

    x2+y2+2x−4y+2C1=0.x^2 + y^2 + 2x - 4y + 2C_1 = 0.

    Write C=2C1C = 2C_1⁠. Then the general solution is

    x2+y2+2x−4y+C=0.x^2 + y^2 + 2x - 4y + C = 0.
    Multiplying by −2-2 clears the fractions. Since C1C_1 can be any real number, so can 2C12C_1⁠; naming it CC keeps the answer clean without losing any solution. There is still exactly one arbitrary constant, as order 1 requires.
    A fixed multiple of an arbitrary constant is again an arbitrary constant. Basics: order n gives n constants
  5. Check: put the answer back into the equation

    Differentiate x2+y2+2x−4y+C=0x^2 + y^2 + 2x - 4y + C = 0 with respect to xx⁠, treating yy as a function of xx⁠:

    2x+2ydydx+2−4dydx=0(2y−4)dydx=−(2x+2)dydx=x+12−y.\begin{aligned} 2x + 2y\frac{dy}{dx} + 2 - 4\frac{dy}{dx} &= 0 \\ (2y - 4)\frac{dy}{dx} &= -(2x + 2) \\ \frac{dy}{dx} &= \frac{x + 1}{2 - y}. \end{aligned}
    This is exactly the given equation, for every value of CC⁠, so the relation really is a solution. The last line divides by 2y−4=−2(2−y)2y - 4 = -2(2 - y)⁠, which is not 0 because y≠2y \ne 2⁠. The constant CC disappears on differentiation, as an arbitrary constant must.
    Implicit differentiation (Section 5.3.2). Basics: y′ is the slope
  6. What the solution curves look like

    Complete the squares in xx and in yy⁠:

    (x+1)2+(y−2)2=5−C.(x + 1)^2 + (y - 2)^2 = 5 - C.

    For C<5C < 5 this is a circle with centre (−1,2)(-1, 2) and radius 5−C\sqrt{5 - C}⁠. (For C=5C = 5 it is the single point (−1,2)(-1, 2)⁠, which has y=2y = 2⁠; for C>5C > 5 there are no real points.) The line y=2y = 2 is excluded, so each circle splits into an upper and a lower half, and each half is a solution curve. At the two points where a circle meets y=2y = 2⁠, its tangent is vertical: there the slope x+12−y\frac{x + 1}{2 - y} would be infinite.

    X Y X′ Y′ C = 4 C = 1 C = −4 (−1, 2) y = 2 O
    Slope field of dydx=x+12−y\frac{dy}{dx} = \frac{x + 1}{2 - y} with equal scales: at each grid point a short mark has the slope the equation gives. The circles C=4,1,−4C = 4, 1, -4 (radii 1, 2, 3 about (−1,2)(-1, 2)⁠) follow the marks. No mark is drawn on y=2y = 2⁠, where the slope is not defined.
    The picture shows what "general solution" means: one curve for each value of the constant, and every curve follows the slope marks. Here different values of CC give circles of different sizes about the same centre.
    A differential equation is a rule for slopes at every point. Basics: dy/dx = F(x, y) draws an arrow at every point
Result

The general solution is x2+y2+2x−4y+C=0x^2 + y^2 + 2x - 4y + C = 0⁠, where C=2C1C = 2C_1 is an arbitrary constant (y≠2y \ne 2⁠). Its curves are circles about (−1,2)(-1, 2)⁠. (Textbook answer: x2+y2+2x−4y+C=0x^2 + y^2 + 2x - 4y + C = 0⁠, where C=2C1C = 2C_1⁠.)

Check it with numbers

Take C=1C = 1⁠: the circle (x+1)2+(y−2)2=4(x + 1)^2 + (y - 2)^2 = 4⁠. Its upper half is y=2+4−(x+1)2y = 2 + \sqrt{4 - (x + 1)^2}⁠. At x=0x = 0⁠, y=2+3≈3.7320508y = 2 + \sqrt3 \approx 3.7320508⁠, and the equation gives the slope 0+12−3.7320508≈−0.577350\frac{0 + 1}{2 - 3.7320508} \approx -0.577350⁠.

The curve itself: y(0.001)≈3.7314730723y(0.001) \approx 3.7314730723 and y(−0.001)≈3.7326277731y(-0.001) \approx 3.7326277731⁠, so

3.7314730723−3.73262777310.002≈−0.577350.\begin{aligned} &\frac{3.7314730723 - 3.7326277731}{0.002} \\ &\approx -0.577350. \end{aligned}

The two slopes agree.

Common mistakes
  1. Integrating x+12−y\frac{x + 1}{2 - y} "with respect to xx" while yy is still in it. Separate first; then each integral has one variable.
  2. Two constants, one on each side. They combine into one; a first order equation has one arbitrary constant.
  3. Forgetting the condition y≠2y \ne 2 when multiplying by 2−y2 - y⁠.
  4. Sign slips when tidying: multiplying 2y−y222y - \frac{y^2}{2} by −2-2 gives −4y+y2-4y + y^2⁠.
What to take away
  1. Separable means dydx=g(x) h(y)\frac{dy}{dx} = g(x)\,h(y)⁠: put yy with dydy⁠, xx with dxdx⁠, integrate, add one constant.
  2. Renaming 2C12C_1 as CC is allowed and loses nothing.
  3. An implicit answer is checked by implicit differentiation.

Every fact used, and where it comes from

FactUsed inSource
Variables separable form dydx=h(y) g(x)\frac{dy}{dx} = h(y)\,g(x)⁠, h(y)≠0h(y) \ne 0⁠, and H(y)=G(x)+CH(y) = G(x) + CSteps 1, 2, 3Section 9.4.1, equations (2) to (4) (Lesson)
∫tn dt=tn+1n+1+C\int t^n\,dt = \frac{t^{n+1}}{n + 1} + CStep 3Section 7.2, formula (i) (Basics)
One arbitrary constant for a first order equation; renaming C=2C1C = 2C_1Steps 3, 4Chapter Summary; the book's working of Example 4 (Basics)
Implicit differentiationStep 5Chapter 5, Section 5.3.2 (Basics)
(x−h)2+(y−k)2=r2(x - h)^2 + (y - k)^2 = r^2 is a circle with centre (h,k)(h, k) and radius rrStep 6Class XI, conic sections
dydx\frac{dy}{dx} is the slope of the tangent, so the equation gives a slope at every point (the slope field)Step 6Section 9.4.1, Example 8; Section 9.3, solution curves (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 →