Exact Equations & Substitutions

Study Sheet

Exact Equations & Substitutions

Exactness tests, integrating factors, Bernoulli and homogeneous types

Exactness and the Great Substitutions

Tip
Exact equations: one function behind two coefficients
xy−3−2−112−2−112
Solutions of 2xy dx+x2 dy=02xy\,dx + x^2\,dy = 0: the level curves x2y=Cx^2y = C for C=±1C = \pm1 and, farther out, C=±3C = \pm3.

The form M(x,y) dx+N(x,y) dy=0M(x,y)\,dx + N(x,y)\,dy = 0 is exact when some FF has Fx=MF_x = M and Fy=NF_y = N — then solutions are simply the level curves F(x,y)=CF(x, y) = C. The test is Clairaut in disguise: exactness holds iff ∂yM=∂xN\partial_y M = \partial_x N (both equal the mixed partial FxyF_{xy}). For example, 2xy dx+x2 dy=02xy\,dx + x^2\,dy = 0 has My=2x=NxM_y = 2x = N_x and comes from F=x2yF = x^2y: its solutions are the curves x2y=Cx^2y = C.

Why level curves: along a solution y(x)y(x), the chain rule gives ddxF(x,y(x))=Fx+Fy y′=M+Ny′\dfrac{d}{dx}F(x, y(x)) = F_x + F_y\,y' = M + N y', which is zero exactly when the equation holds. So FF is constant along every solution. To build FF: integrate MM in xx (adding an unknown g(y)g(y)), differentiate in yy, and match against NN to determine gg — the same construction as finding a potential for a conservative vector field, because it is the same problem.

Tip
When the test fails: integrating factors

A non-exact equation can often be repaired by multiplying through by μ\mu. Try single-variable factors first: if My−NxN\dfrac{M_y - N_x}{N} depends on xx alone, μ=e∫My−NxNdx\mu = e^{\int\frac{M_y - N_x}{N}dx} works; if Nx−MyM\dfrac{N_x - M_y}{M} depends on yy alone, use the analogous μ(y)\mu(y).

Example: y dx+2x dyy\,dx + 2x\,dy has My=1≠2=NxM_y = 1 \ne 2 = N_x, but μ=y\mu = y turns it into y2dx+2xy dy=d(xy2)y^2dx + 2xy\,dy = d(xy^2) — exact. The linear-equation integrating factor from first-order theory is a special case of this idea. Where the formula comes from: with μ=μ(x)\mu = \mu(x), exactness of μM dx+μN dy\mu M\,dx + \mu N\,dy reads μMy=μ′N+μNx\mu M_y = \mu' N + \mu N_x, i.e. μ′μ=My−NxN\dfrac{\mu'}{\mu} = \dfrac{M_y - N_x}{N}. The left side depends on xx only, so this can be solved for μ(x)\mu(x) exactly when the right side does too.

Tip
Two substitutions that unlock whole families

Homogeneous type y′=f ⁣(yx)y' = f\!\left(\tfrac yx\right): substitute v=yxv = \tfrac yx (so y′=v+xv′y' = v + xv') and the equation separates in vv and xx. Bernoulli y′+p(x)y=q(x)yny' + p(x)y = q(x)y^n: divide by yny^n and substitute v=y1−nv = y^{1-n} — the equation becomes linear in vv, solvable by integrating factor.

Both are one-line changes of viewpoint that convert something unsolvable-looking into a solved chapter; recognizing the pattern is the entire skill. The mechanism in the homogeneous case: y=vxy = vx gives y′=v+xv′y' = v + xv' by the product rule, while the right side becomes f(v)f(v), so xv′=f(v)−vxv' = f(v) - v — the variables separate.

Side note
Significance: thermodynamics runs on exactness

In physics, "is M dx+N dyM\,dx + N\,dy exact?" becomes "is this quantity a state function?" Energy and entropy are exact differentials (path-independent); heat and work are not — and integrating factors are precisely how temperature turns the inexact heat differential into exact entropy: dS=δQTdS = \tfrac{\delta Q}{T}. A chapter of calculus explaining a law of nature.

Try it
Try it: test, then decide

Is (y2+1) dx+2xy dy=0(y^2 + 1)\,dx + 2xy\,dy = 0 exact? If so, solve it.

Show the answer

Test: M=y2+1M = y^2 + 1 and N=2xyN = 2xy give My=2yM_y = 2y and Nx=2yN_x = 2y; they are equal, so the equation is exact. Build FF: integrating MM in xx gives F=xy2+x+g(y)F = xy^2 + x + g(y), and Fy=2xy+g′(y)F_y = 2xy + g'(y) must equal N=2xyN = 2xy, so g′=0g' = 0. The solutions are x(y2+1)=Cx(y^2 + 1) = C, that is, x=Cy2+1x = \dfrac{C}{y^2 + 1}. Verify: d[x(y2+1)]=(y2+1) dx+2xy dyd\left[x(y^2 + 1)\right] = (y^2 + 1)\,dx + 2xy\,dy ✓, exactly the original form. (The equation also separates, dxx=−2y dyy2+1\tfrac{dx}{x} = -\tfrac{2y\,dy}{y^2 + 1}, and gives the same curves.)

Building the Potential, with Initial Data

Tip
The construction, and why g depends on y alone

To solve an exact equation M dx+N dy=0M\,dx + N\,dy = 0:

  • integrate MM with respect to xx, holding yy fixed: F=∫M dx+g(y)F = \int M\,dx + g(y);
  • differentiate in yy and set Fy=NF_y = N; this determines g′(y)g'(y);
  • integrate to get gg;
  • the solutions are the curves F(x,y)=CF(x, y) = C, and an initial point (x0,y0)(x_0, y_0) fixes C=F(x0,y0)C = F(x_0, y_0).

Step 2 always produces an equation for g′g' with no xx in it, and that is exactly where exactness is used: N−∂y ⁣∫M dxN - \partial_y\!\int M\,dx has xx-derivative Nx−My=0N_x - M_y = 0, so it depends on yy alone. If an xx survives in g′(y)g'(y), the equation was not exact or an integration slipped. The solution through (x0,y0)(x_0, y_0) is the level curve F=F(x0,y0)F = F(x_0, y_0); read as a function y(x)y(x), it continues until the curve turns vertical, which happens where N=0N = 0.

Example
Worked: a level curve that is an ellipse
xy−3−2−112−3−2−112(1, 1)
Level curves x2+xy+y2=1,3,6x^2 + xy + y^2 = 1, 3, 6; the solution through (1,1)(1, 1) is the solid arc, ending where the tangent turns vertical.

Solve (2x+y) dx+(x+2y) dy=0(2x + y)\,dx + (x + 2y)\,dy = 0 with y(1)=1y(1) = 1, and find where the solution y(x)y(x) exists.

Step 1 — test: My=1=NxM_y = 1 = N_x, so the equation is exact.

Step 2 — integrate MM in xx: F=x2+xy+g(y)F = x^2 + xy + g(y).

Step 3 — match: Fy=x+g′(y)F_y = x + g'(y) must equal N=x+2yN = x + 2y, so g′=2yg' = 2y, g=y2g = y^2 and F=x2+xy+y2F = x^2 + xy + y^2.

Step 4 — the data: F(1,1)=3F(1, 1) = 3, so the solution curve is x2+xy+y2=3x^2 + xy + y^2 = 3, an ellipse.

Step 5 — as a function: solving the quadratic in yy gives y=−x±12−3x22y = \dfrac{-x \pm\sqrt{12 - 3x^2}}{2}, and the ++ sign is the one with y(1)=−1+32=1y(1) = \dfrac{-1 + 3}{2} = 1.

Step 6 — where it lives: the tangent turns vertical where N=x+2y=0N = x + 2y = 0, which on the ellipse happens at (2,−1)(2, -1) and (−2,1)(-2, 1). The solution exists on −2<x<2-2 < x < 2; the lower half of the ellipse is a different solution, the one through (1,−2)(1, -2).

Example
Worked: an exponential potential

Solve (yexy+2x)dx+(xexy−2y)dy=0\left(ye^{xy} + 2x\right)dx + \left(xe^{xy} - 2y\right)dy = 0 with y(0)=1y(0) = 1.

Step 1 — test, using the product rule: My=exy+xyexyM_y = e^{xy} + xye^{xy} and Nx=exy+xyexyN_x = e^{xy} + xye^{xy}, so the equation is exact.

Step 2 — integrate MM in xx: ∫yexy dx=exy\int ye^{xy}\,dx = e^{xy}, so F=exy+x2+g(y)F = e^{xy} + x^2 + g(y).

Reminder — The differentiation rules:  (xn)′=nxn−1,(fg)′=f′g+fg′,(fg)′=f′g−fg′g2,(f(g(x)))′=f′(g(x))g′(x)(x^{n})'=nx^{n-1},\quad (fg)'=f'g+fg',\quad \left(\tfrac{f}{g}\right)'=\frac{f'g-fg'}{g^{2}},\quad \big(f(g(x))\big)'=f'(g(x))g'(x)

Step 3 — match: Fy=xexy+g′(y)F_y = xe^{xy} + g'(y) must equal xexy−2yxe^{xy} - 2y, so g′=−2yg' = -2y and g=−y2g = -y^2.

Step 4 — F=exy+x2−y2F = e^{xy} + x^2 - y^2, and F(0,1)=1+0−1=0F(0, 1) = 1 + 0 - 1 = 0, so the solution is the curve exy+x2−y2=0e^{xy} + x^2 - y^2 = 0.

Step 5 — verify by implicit differentiation: exy(y+xy′)+2x−2yy′=0e^{xy}(y + xy') + 2x - 2yy' = 0 rearranges to (yexy+2x)+(xexy−2y)y′=0(ye^{xy} + 2x) + (xe^{xy} - 2y)y' = 0 ✓. No formula for yy in elementary functions exists here; the implicit curve is the answer.

Side note
Where it goes wrong: adding both integrals

For (2xy+3) dx+(x2+4y) dy=0(2xy + 3)\,dx + (x^2 + 4y)\,dy = 0, a tempting shortcut adds ∫M dx=x2y+3x\int M\,dx = x^2y + 3x and ∫N dy=x2y+2y2\int N\,dy = x^2y + 2y^2 to get F=2x2y+3x+2y2F = 2x^2y + 3x + 2y^2. Test it: Fx=4xy+3≠MF_x = 4xy + 3 \ne M. The term x2yx^2y appears in both integrals and has been counted twice. Each integral recovers FF except for a missing piece, and the pieces overlap; the matching step Fy=NF_y = N is what keeps each term once. The correct potential is x2y+3x+2y2x^2y + 3x + 2y^2.

Try it
Try it: exact, through a point

Show that (2xy2+1) dx+(2x2y+3y2) dy=0(2xy^2 + 1)\,dx + (2x^2y + 3y^2)\,dy = 0 is exact, and find the solution curve through (0,1)(0, 1).

Show the answer

Test: My=4xyM_y = 4xy and Nx=4xyN_x = 4xy, so it is exact. Integrate MM in xx: F=x2y2+x+g(y)F = x^2y^2 + x + g(y). Match: Fy=2x2y+g′(y)F_y = 2x^2y + g'(y) must equal 2x2y+3y22x^2y + 3y^2, so g′=3y2g' = 3y^2 and g=y3g = y^3. Then F=x2y2+x+y3F = x^2y^2 + x + y^3 and F(0,1)=1F(0, 1) = 1, so the solution curve is x2y2+x+y3=1x^2y^2 + x + y^3 = 1. Check by implicit differentiation: (2xy2+1)+(2x2y+3y2) y′=0(2xy^2 + 1) + (2x^2y + 3y^2)\,y' = 0 ✓.

Substitutions in Practice

Tip
Three substitutions and how to spot them
  • y′=f ⁣(yx)y' = f\!\left(\tfrac yx\right), every term of the same total degree: set v=yxv = \tfrac yx, so y′=v+xv′y' = v + xv'; the equation separates.
  • y′+p(x)y=q(x)yny' + p(x)y = q(x)y^n with n≠0,1n \ne 0, 1 (Bernoulli): set v=y1−nv = y^{1-n}; the equation becomes linear in vv.
  • y′=f(ax+by+c)y' = f(ax + by + c): set u=ax+by+cu = ax + by + c, so u′=a+b f(u)u' = a + b\,f(u), which separates.

Each substitution turns the troublesome combination into a single new unknown. In the homogeneous case the right side depends on xx and yy only through v=yxv = \tfrac yx, and y′=v+xv′y' = v + xv' leaves xx appearing only as a factor, so the variables separate. In the Bernoulli case, y−ny′y^{-n}y' is, up to the constant 1−n1 - n, the derivative of y1−ny^{1-n}, so dividing by yny^n makes v=y1−nv = y^{1-n} appear linearly. In the third case the right side is constant along the lines ax+by+c=uax + by + c = u, so tracking uu alone is enough. After solving, substitute back and check against the original equation.

Example
Worked: a homogeneous equation with a logarithm

Solve xy′=y+xe−y/xxy' = y + xe^{-y/x} for x>0x > 0, with y(1)=0y(1) = 0.

Step 1 — divide by xx: y′=yx+e−y/xy' = \dfrac yx + e^{-y/x}, a function of yx\tfrac yx alone.

Step 2 — with v=yxv = \tfrac yx and y′=v+xv′y' = v + xv': v+xv′=v+e−vv + xv' = v + e^{-v}, so xv′=e−vxv' = e^{-v}.

Step 3 — separate: ev dv=dxxe^{v}\,dv = \dfrac{dx}{x}, so ev=ln⁡x+Ce^{v} = \ln x + C.

Step 4 — the data: v(1)=0v(1) = 0 gives 1=0+C1 = 0 + C. Then ev=1+ln⁡xe^{v} = 1 + \ln x, v=ln⁡(1+ln⁡x)v = \ln(1 + \ln x), and y=xln⁡(1+ln⁡x)y = x\ln(1 + \ln x).

Step 5 — interval: the logarithm needs 1+ln⁡x>01 + \ln x > 0, so the solution lives on x>e−1x > e^{-1}.

Step 6 — verify: y′=ln⁡(1+ln⁡x)+11+ln⁡xy' = \ln(1 + \ln x) + \dfrac{1}{1 + \ln x}, and yx+e−y/x=ln⁡(1+ln⁡x)+11+ln⁡x\dfrac yx + e^{-y/x} = \ln(1 + \ln x) + \dfrac{1}{1 + \ln x} ✓.

Example
Worked: a Bernoulli equation that blows up
xy0.511.521234(1, 1)
Slope field of y′=xy2−yxy' = xy^2 - \tfrac yx: the solution through (1,1)(1, 1) lives on 0<x<20 < x < 2 and blows up at x=2x = 2 (dashed).

Solve y′+1x y=xy2y' + \dfrac1x\,y = xy^2 for x>0x > 0, with y(1)=1y(1) = 1.

Step 1 — Bernoulli with n=2n = 2; divide by y2y^2: y−2y′+1x y−1=xy^{-2}y' + \dfrac1x\,y^{-1} = x.

Step 2 — set v=y−1v = y^{-1}, so v′=−y−2y′v' = -y^{-2}y': the equation becomes −v′+vx=x-v' + \dfrac vx = x, that is, v′−1x v=−xv' - \dfrac1x\,v = -x, linear in vv.

Step 3 — integrating factor μ=e−ln⁡x=1x\mu = e^{-\ln x} = \dfrac1x: (vx)′=−1\left(\dfrac vx\right)' = -1, so vx=−x+C\dfrac vx = -x + C and v=Cx−x2v = Cx - x^2.

Step 4 — the data: v(1)=1v(1) = 1 gives C=2C = 2, so v=2x−x2v = 2x - x^2.

Step 5 — back to yy: y=12x−x2=1x(2−x)y = \dfrac{1}{2x - x^2} = \dfrac{1}{x(2 - x)}.

Step 6 — interval: vv vanishes at x=0x = 0 and x=2x = 2, so the solution lives on 0<x<20 < x < 2 and blows up at both ends, although the equation is perfectly smooth at x=2x = 2.

Step 7 — verify: y′=2x−2(2x−x2)2y' = \dfrac{2x - 2}{(2x - x^2)^2}, and xy2−yx=x−(2−x)(2x−x2)2=2x−2(2x−x2)2xy^2 - \dfrac yx = \dfrac{x - (2 - x)}{(2x - x^2)^2} = \dfrac{2x - 2}{(2x - x^2)^2} ✓.

Example
Worked: a linear argument

Solve y′=(x+y)2y' = (x + y)^2, y(0)=0y(0) = 0.

Step 1 — the right side is a function of u=x+yu = x + y alone.

Step 2 — differentiate the new unknown: u′=1+y′=1+u2u' = 1 + y' = 1 + u^2, which separates.

Step 3 — ∫du1+u2=∫dx\displaystyle\int\frac{du}{1 + u^2} = \int dx gives arctan⁡u=x+C\arctan u = x + C, and u(0)=0u(0) = 0 gives C=0C = 0.

Step 4 — so u=tan⁡xu = \tan x and y=tan⁡x−xy = \tan x - x, on ∣x∣<π2|x| < \tfrac\pi2.

Step 5 — verify: y′=sec⁡2x−1=tan⁡2x=(x+y)2y' = \sec^2 x - 1 = \tan^2 x = (x + y)^2 ✓.

Side note
Where it goes wrong: a dropped chain-rule sign

In y′+y=y2y' + y = y^2 with v=y−1v = y^{-1}, writing v′=y−2y′v' = y^{-2}y' (dropping the minus sign) turns the equation into v′+v=1v' + v = 1, with v=1+Ce−xv = 1 + Ce^{-x}; the data y(0)=12y(0) = \tfrac12 give C=1C = 1 and y=11+e−xy = \dfrac{1}{1 + e^{-x}}. It fails the check: this yy increases, y′=e−x(1+e−x)2>0y' = \dfrac{e^{-x}}{(1 + e^{-x})^2} > 0, while y2−y=y(y−1)<0y^2 - y = y(y - 1) < 0 for 0<y<10 < y < 1. With the correct v′=−y−2y′v' = -y^{-2}y' the answer is y=11+exy = \dfrac{1}{1 + e^{x}}, worked in full in the last section.

Try it
Try it: pick the substitution

Solve y′=y2+2xyx2y' = \dfrac{y^2 + 2xy}{x^2} with y(1)=1y(1) = 1.

Show the answer

Every term has degree 22 over degree 22, so the equation is of homogeneous type: with v=yxv = \tfrac yx it reads y′=v2+2vy' = v^2 + 2v. With y′=v+xv′y' = v + xv': xv′=v2+vxv' = v^2 + v. Separate, using partial fractions: dvv(v+1)=(1v−1v+1)dv=dxx\dfrac{dv}{v(v + 1)} = \left(\dfrac1v - \dfrac{1}{v + 1}\right)dv = \dfrac{dx}{x}, so ln⁡∣vv+1∣=ln⁡x+c\ln\left|\dfrac{v}{v + 1}\right| = \ln x + c, i.e. vv+1=Kx\dfrac{v}{v + 1} = Kx. Data: v(1)=1v(1) = 1 gives K=12K = \tfrac12. Solving vv+1=x2\dfrac{v}{v + 1} = \dfrac x2 gives v=x2−xv = \dfrac{x}{2 - x}, so y=x22−xy = \dfrac{x^2}{2 - x}, for 0<x<20 < x < 2. Verify: y′=4x−x2(2−x)2y' = \dfrac{4x - x^2}{(2 - x)^2} and y2+2xyx2=x2+2x(2−x)(2−x)2=4x−x2(2−x)2\dfrac{y^2 + 2xy}{x^2} = \dfrac{x^2 + 2x(2 - x)}{(2 - x)^2} = \dfrac{4x - x^2}{(2 - x)^2} ✓.

Proofs & Why It Matters

Tip
Proof: the exactness test

If FF exists with Fx=MF_x = M, Fy=NF_y = N and FF is twice continuously differentiable, then My=Fxy=Fyx=NxM_y = F_{xy} = F_{yx} = N_x by Clairaut's theorem — necessity.

Conversely, on a rectangle define F(x,y)=∫x0xM(t,y) dt+∫y0yN(x0,s) dsF(x,y) = \int_{x_0}^x M(t, y)\,dt + \int_{y_0}^y N(x_0, s)\,ds; then Fx=MF_x = M directly, and differentiating under the integral, Fy=∫x0xMy dt+N(x0,y)=∫x0xNx dt+N(x0,y)=N(x,y)F_y = \int_{x_0}^x M_y\,dt + N(x_0, y) = \int_{x_0}^x N_x\,dt + N(x_0,y) = N(x, y), using My=NxM_y = N_x in the middle step. ■\blacksquare

Tip
Proof: the Bernoulli substitution linearizes

From v=y1−nv = y^{1-n}: v′=(1−n)y−ny′v' = (1-n)y^{-n}y'. Multiply the equation y′+py=qyny' + py = qy^n by (1−n)y−n(1-n)y^{-n}: (1−n)y−ny′+(1−n)py1−n=(1−n)q(1-n)y^{-n}y' + (1-n)py^{1-n} = (1-n)q, which is exactly v′+(1−n)p v=(1−n)qv' + (1-n)p\,v = (1-n)q — linear in vv with known coefficient functions. Every Bernoulli equation is therefore one substitution away from the integrating-factor method. ■\blacksquare

Going Deeper: Worked Problems

Example
Worked: repairing a non-exact equation

Solve (3xy+y2) dx+(x2+xy) dy=0(3xy + y^2)\,dx + (x^2 + xy)\,dy = 0.

Step 1 — test: My=3x+2yM_y = 3x + 2y, Nx=2x+yN_x = 2x + y — not exact.

Step 2 — try a factor in xx: My−NxN=x+yx(x+y)=1x\dfrac{M_y - N_x}{N} = \dfrac{x + y}{x(x + y)} = \dfrac1x, a function of xx alone, so μ=e∫dx/x=x\mu = e^{\int dx/x} = x.

Step 3 — multiply: (3x2y+xy2) dx+(x3+x2y) dy=0(3x^2y + xy^2)\,dx + (x^3 + x^2y)\,dy = 0; now My=3x2+2xy=NxM_y = 3x^2 + 2xy = N_x ✓.

Step 4 — build FF: integrate MM in xx: F=x3y+12x2y2+g(y)F = x^3y + \tfrac12x^2y^2 + g(y); match Fy=x3+x2y+g′(y)=NF_y = x^3 + x^2y + g'(y) = N, so g′=0g' = 0. Solutions: x3y+12x2y2=Cx^3y + \tfrac12x^2y^2 = C.

Step 5 — implicit differentiation of the answer reproduces the original equation (after dividing by xx) ✓.

Example
Worked: a homogeneous-type equation to the end

Solve y′=x2+y2xyy' = \dfrac{x^2 + y^2}{xy} with y(1)=2y(1) = 2.

Step 1 — every term has total degree 22 over degree 22: homogeneous type. Rewrite y′=xy+yxy' = \dfrac xy + \dfrac yx and substitute v=yxv = \dfrac yx, so y′=v+xv′y' = v + xv'.

Step 2 — the equation becomes v+xv′=1v+vv + xv' = \dfrac1v + v, i.e. xv′=1vxv' = \dfrac1v: separable.

Step 3 — v dv=dxxv\,dv = \dfrac{dx}{x} gives v22=ln⁡∣x∣+C\tfrac{v^2}{2} = \ln|x| + C.

Step 4 — back-substitute: y22x2=ln⁡∣x∣+C\dfrac{y^2}{2x^2} = \ln|x| + C; the data y(1)=2y(1) = 2 give 2=0+C2 = 0 + C. Solution: y2=2x2(ln⁡x+2)y^2 = 2x^2(\ln x + 2), i.e. y=x2ln⁡x+4y = x\sqrt{2\ln x + 4} for x>0x > 0.

Step 5 — check at x=1x = 1: y=4=2y = \sqrt4 = 2 ✓.

Worked, Every Step

Example
Worked: an exact equation start to finish

Solve (2xy+3) dx+(x2+4y) dy=0(2xy + 3)\,dx + (x^2 + 4y)\,dy = 0.

Step 1 — test: ∂y(2xy+3)=2x\partial_y(2xy + 3) = 2x and ∂x(x2+4y)=2x\partial_x(x^2 + 4y) = 2x: exact.

Step 2 — integrate MM in xx: F=x2y+3x+g(y)F = x^2y + 3x + g(y).

Step 3 — match: Fy=x2+g′(y)=!x2+4yF_y = x^2 + g'(y) \stackrel{!}{=} x^2 + 4y, so g′(y)=4yg'(y) = 4y, g=2y2g = 2y^2.

Step 4 — solutions: x2y+3x+2y2=Cx^2y + 3x + 2y^2 = C, an implicit family; a point condition picks the curve.

Step 5 — verify by implicit differentiation: 2xy+x2y′+3+4yy′=02xy + x^2y' + 3 + 4yy' = 0 rearranges to the original equation ✓.

Example
Worked: a Bernoulli equation via v = 1/y

Solve y′+y=y2y' + y = y^2, y(0)=12y(0) = \tfrac12.

Step 1 — divide by y2y^2: y−2y′+y−1=1y^{-2}y' + y^{-1} = 1.

Step 2 — substitute v=y−1v = y^{-1}, v′=−y−2y′v' = -y^{-2}y': −v′+v=1-v' + v = 1, i.e. v′−v=−1v' - v = -1.

Step 3 — integrating factor e−xe^{-x}: (ve−x)′=−e−x(ve^{-x})' = -e^{-x}, so ve−x=e−x+Cve^{-x} = e^{-x} + C and v=1+Cexv = 1 + Ce^{x}.

Step 4 — data: v(0)=2v(0) = 2 gives C=1C = 1: y=11+exy = \dfrac{1}{1 + e^x}.

Step 5 — verify: y′=−ex(1+ex)2y' = \dfrac{-e^x}{(1+e^x)^2} and y2−y=1−(1+ex)(1+ex)2=−ex(1+ex)2y^2 - y = \dfrac{1 - (1 + e^x)}{(1+e^x)^2} = \dfrac{-e^x}{(1+e^x)^2} ✓.